• Welcome to PlanetSquires Forums.
 

WinFBE - Line Numbers In Form files

Started by SeaVipe, June 02, 2022, 04:56:08 PM

Previous topic - Next topic

SeaVipe

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
Clive Richey

Paul Squires

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?
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

philbar

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.

SeaVipe

Quote from: Paul Squires on June 03, 2022, 07:00: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

Clive Richey

Paul Squires

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer