Page 1 of 1

IDE Source code line number

Posted: Thu Jun 16, 2022 6:40 am
by adale
Not sure if this is even possible, but does anyone know if the IDE source code line number is stored any where that could be referenced?

I am using the sys_web.Console.Log feature for some debugging, and would like to include the source code line number in my console output.

This was a trick used when debugging RPG, to output the source line number with other pertinent info to a file, and then I could quickly and easily see where the last executed command was, and in what sequence if the code was not exactly in top-down sequence (subroutine, etc.).

Re: IDE Source code line number

Posted: Thu Jun 16, 2022 1:51 pm
by Dino
I don't see how you can get that from the client running in the browser.
I use the #sys_web.console.log to assist with finding bugs in programs,
but I normally add something in the text to know where I am, like
#sys_web.console.log 'routine xyz before the loop"
stuff like that

Re: IDE Source code line number

Posted: Fri Jun 17, 2022 12:44 am
by adale
I thought it might be reaching too far, but worth asking as you just never know.

I have these two lines in a template for quick console debug entry, and just modify as I need for each specific debug instance.

* Console - debug
#sys_web.Console.Log( ('LINE-# ROUTINE: Message or other debug info' + ' - ' + #FIELD) )

Re: IDE Source code line number

Posted: Fri May 30, 2025 3:36 am
by adale
Hey Dino,
Check out: https://docs.lansa.com/15/en/lansa016/P ... ANDLER.htm
Specifically the field #LineNumber
Cool feature to list the source line number from where you are implementing the trace. Nice as source line number changes over time, you still will have a reference to the current (latest compiled) line number.

Re: IDE Source code line number

Posted: Wed Jun 04, 2025 6:42 am
by davidbalansa
Hi Arlyn,

Nice find. I like how the console messages are only written when the trace parameter is specified on the URL. No need to comment out messages once you have finished debugging.

Regards,
David