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?
Self-awareness re line numbers
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 52
- Joined: Mon Apr 06, 2020 1:19 pm
- Location: Thailand
- Contact:
Re: Self-awareness re line numbers
Hi,
try:
Have fun!
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
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
-
- Posts: 52
- Joined: Mon Apr 06, 2020 1:19 pm
- Location: Thailand
- Contact:
Re: Self-awareness re line numbers
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
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