Hi Paul,
Is it possible to have a value similar to __LINE__ that would be accurate when used in Form files? Reading the form's file and subtracting the line number associated with "WINFBE_CODEGEN_END" from __LINE__ might work but nothing I come up with is particularly elegant (or functional). :|
Category: WishList
I would first question as to why such a feature would be needed? Can you describe what it is you are doing that makes it necessary to inspect the resulting Form source file?
Seavipe, did you try this:
const lline = __LINE__
' frmMain form code file
''
''
...
...
...
print "This is physical line "; __LINE__; " but virtual line "; __LINE__ - lline + 1
No need to look at the hidden code.
Quote from: Paul Squires on June 03, 2022, 07:30:00 AM
I would first question as to why such a feature would be needed? Can you describe what it is you are doing that makes it necessary to inspect the resulting Form source file?
Hi Paul,
Almost exclusively for debugging, like:
On Local Error GoTo errhandler
line_num = __LINE__
errhandler:
? sNote, LCase(__FUNCTION__), __FILE__, line_num
In all but Form modules this works just fine.
Thanks @philbar your suggestion works, I'll create a unique CONST for each Form.
const lline = __LINE__
' frmMain form code file
print "This is physical line "; __LINE__; " but virtual line "; __LINE__ - lline + 1
Pretty cool solution!