PxPlus User Forum
Main Board => Discussions => Language => Topic started by: James Zukowski on April 02, 2021, 06:42:31 PM
-
It seems like the pgm() function only allows a line NUMBER for a statement reference, not a LABEL.
It also seems like it's the only operation in PxPlus (besides AUTO) that requires a line number and will not permit a label.
Does anyone know if this will ever change? Or does anyone knows a simple way to retrieve a line based on the label, rather than the number, without actually scanning through the program (which I can do but prefer not)?
Thanks in advance!
Stay safe out there!
-
Use LNO() to get the line number.
10 LABEL:
20 PRINT LNO(LABEL)
RUN
10
-
Good to know. But if we want it from another program in the stack, that's still a problem.
Thanks!
-
You might like to know we added an option to allow a string value to be passed to the LNO function in PxPlus 2021 due this May.
For example:
X$="LABEL"
Goto lno(x$)
-
Also sounds good.
What I'm trying to do is define a (global) function that is passed an IOLIST pointer, and does it's thing based on that. Passing a line number works OK, since pgm() works with those. But a label reference doesn't. The obvious workaround is to use lno(Label) as the parameter, rather than "Label".
If things change, that would be wonderful. ;D
Thanks, all!