Get Line Number

KleineCuypie

New Member
Hello guys,

Does anyone know if it's possible to get the current line-number or something similar?
I'm writing a logfile and I'm trying to add the line-number to the logfile so I know where the problem exactly occured.

Greetz,
KleineCuypie
 

rzr

Member
what is the "source of data" for this log file ? a temp-table or do you just do "PUT / EXPORT" when you run into some errors ?
 

rzr

Member
btw.. how does adding line# to log file help you identify the "exact problem" from the log file? Surely you'd have to read thru the log file or search for specific "error" string in log file... would'nt you ?
 

KleineCuypie

New Member
Well I'm making a logfile that says for example: Error in function getCustomer -> Could not find customer by id 123456 (error at line: 'line number').
Would help a little if you'd have to search things when errors occured. If this is possible.
 

GregTomkins

Active Member
Try eg. MESSAGE "{&LINE-NUMBER}" "function bla is missing a bla record".

However, I think (I have never used it) it counts as if all the .i's were in one big file, which might make it not that useful.
 

Stefan

Well-Known Member
Try eg. MESSAGE "{&LINE-NUMBER}" "function bla is missing a bla record".

However, I think (I have never used it) it counts as if all the .i's were in one big file, which might make it not that useful.

It actually does print the line number within the include file. So you could add:

Code:
MESSAGE "{&FILE-NAME}" {&LINE-NUMBER}.

If it were all one big file, then you can use the DEBUG-LIST option on the COMPILE statement to get the line number as reported by error messages.
 
Top