IDE Source code line number

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

IDE Source code line number

Post 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.).
Arlyn Dale
Servias LLC
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: IDE Source code line number

Post 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
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: IDE Source code line number

Post 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) )
Arlyn Dale
Servias LLC
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: IDE Source code line number

Post 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.
Arlyn Dale
Servias LLC
davidbalansa
Posts: 92
Joined: Mon Feb 01, 2016 10:08 am

Re: IDE Source code line number

Post 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
Post Reply