User Tools

Site Tools


getting_20the_20current_20line_20number

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
getting_20the_20current_20line_20number [2018/04/17 16:30]
tbest3112 Added syntax highlighting
getting_20the_20current_20line_20number [2020/08/19 10:10] (current)
richardrussell Modified to be 64-bit compatible
Line 7: Line 7:
  
         DEF FN_linenumber(E%)         DEF FN_linenumber(E%)
-        LOCAL P% : P% = PAGE +        LOCAL p%% : p%% = PAGE 
-        WHILE ?P% AND P% + ?P% < E% P% += ?P% : ENDWHILE +        WHILE ?p%% AND p%% + ?p%% < (E% + PAGE - !340) p%% += ?p%% : ENDWHILE 
-        = (P%?2*256+P%?1)+        = (p%%?2*256+p%%?1)
 </​code>​ </​code>​
 Always pass **!384** as the parameter to FN_linenumber,​ this [[/​Interpreter%20internal%20variables|interpreter internal variable]] is the pointer to (or within) currently-executing statement. Always pass **!384** as the parameter to FN_linenumber,​ this [[/​Interpreter%20internal%20variables|interpreter internal variable]] is the pointer to (or within) currently-executing statement.
getting_20the_20current_20line_20number.txt · Last modified: 2020/08/19 10:10 by richardrussell