Self-awareness re line numbers
Posted: Sat Aug 21, 2021 5:10 am
Hello All,
Is LC aware of the line number it is on when it executes an instruction? Why am I interested? I sometimes use the rather cheap and dirty tactic when debugging of just putting "answer 'hello'" on a line just to make sure my code executed the code just before it. Sometimes the answer moves around so I'll put "answer 55" where 55 is the line number. Because my code moves around it would be better to be able to say "answer $currentLineNumber" or whatever. Possible? If not, anything similar?
Is LC aware of the line number it is on when it executes an instruction? Why am I interested? I sometimes use the rather cheap and dirty tactic when debugging of just putting "answer 'hello'" on a line just to make sure my code executed the code just before it. Sometimes the answer moves around so I'll put "answer 55" where 55 is the line number. Because my code moves around it would be better to be able to say "answer $currentLineNumber" or whatever. Possible? If not, anything similar?