LST( ) |
Return List Form of Statement |
LST([EDIT][*]internal$[,ERR=stmtref])
Where:
* |
(Asterisk) Returns the listing in colourized syntax. |
Keyword indicating that listing is to be returned with indented format. | |
internal$ |
Character string containing the internal (compiled) form of a PxPlus statement. String expression; e.g. X$=lst(pgm(10)). |
stmtref |
Program line number or statement label to which to transfer control. |
List format from compiled statement.
The LST( ) function converts a PxPlus statement from internal form to normal source format. You must ensure that the string processed by the LST( ) function is a statement in valid internal form. If it is not valid, PxPlus returns either an Error #30: Statement too complex -- cannot compile or an Error #49: <*> Internal program format error <*>.
Use the EDIT keyword to return a formatted statement and the * (asterisk) to display colourized syntax (the 'CS' system parameter must be On):
X$=lst(edit *pgm(10))
'*H' Control Screen Colours
'CS' Coloured Syntax
0030 input "Enter statement to display:",A
0035 if A=0 then goto 2000
0040 let X$=pgm(A,err=1000)
0050 print lst(X$)
0060 goto 0030
1000 print "Cannot find statement"
1010 goto 0030
2000 print "DONE"; stop
->run
Enter statement to display:50
0050 print LST(X$)
Enter statement to display:
DONE