PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: SeaVipe on June 02, 2022, 05:26:08 PM

Title: WinFBE - Line Numbers In Form files
Post by: SeaVipe on June 02, 2022, 05:26:08 PM
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
Title: Re: WinFBE - Line Numbers In Form files
Post by: 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?
Title: Re: WinFBE - Line Numbers In Form files
Post by: philbar on June 03, 2022, 11:32:05 AM
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.
Title: Re: WinFBE - Line Numbers In Form files
Post by: SeaVipe on June 03, 2022, 02:56:11 PM
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

Title: Re: WinFBE - Line Numbers In Form files
Post by: Paul Squires on June 03, 2022, 07:59:15 PM
Pretty cool solution!