The following X++ code sample shows the behavior of the #linenumber directive.
static void LinenumberPhysicalJob(Args _args)
{
;
#define.Debug(light)
#if.Debug
info("Physical Line 8: # linenumber == "
+ int2Str(#linenumber));
#endif
/****************** Actual Infolog output
Message (08:55:26 pm)
Physical Line 8: # linenumber == 8
******************/
}
If you want to know function and line number you can use (in batch job also):
error(funcName()+' - '+"@GLS103859"+": "+int2Str(#linenumber));
error(funcName()+' - '+"@GLS103859"+": "+int2Str(#linenumber));