Page 1 of 1

Self-awareness re line numbers

Posted: Sat Aug 21, 2021 5:10 am
by bbalmerTotalFluency
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?

Re: Self-awareness re line numbers

Posted: Sat Aug 21, 2021 10:23 am
by AxWald
Hi,

try:

Code: Select all

      set itemdel to comma  --  only if you have set it to something different before
      answer item -1 of line -1 of the executionContexts
Have fun!

Re: Self-awareness re line numbers

Posted: Sun Aug 22, 2021 3:49 am
by bbalmerTotalFluency
Since my questions are being read by a lot of people, I'm guessing they are quite useful to others - so I shall not feel too guilty to ask a few more.

I'd like to build a database on the iPhone by reading in the output of .schema from sqlite3 - as in a series of sql DDL statements using .read

AxWald has given me a solution to issuing such dot commands - is there any reason that won't work on iOS?

Bruce