Re: Getting line# in 4GL code
Posted in 1993
>From: uunet!balder.no!arthur (Per Anders Waaler) >Subject: Getting line# in 4GL code >To: tech@informix.com (Technical Support) >Date: Tue, 2 Mar 93 12:42:00 GMT >I have a customer who wants to know if it's possible to get current line >no in a I4GL application. i.e. something like this >main > whenever error call error_h() >end main >function error_h() > define line_no integer > let line_no = cur_line() > error "Failed in line : ", line_no >end function >If anyone have done so in 4GL or using C, please let me know. You cannot do this in I4GL without using some sort of preprocessor. And it would be non-trivial to implement, especially considering that you cannot pass arguments into a function called by WHENEVER ERROR, and when you remember that the error handling function need not be in the same module as the code which invokes it. As was pointed out by someone else, the module name and line number are recorded in the error log file if you have one active, though that is of limited (zero?) value in the context you give. Yours, Jonathan Leffler (johnl@obelix.informix.com) #include <disclaimer.h>