Self-awareness re line numbers

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 52
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Self-awareness re line numbers

Post by bbalmerTotalFluency » 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?

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: Self-awareness re line numbers

Post by AxWald » Sat Aug 21, 2021 10:23 am

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!
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!

bbalmerTotalFluency
Posts: 52
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Re: Self-awareness re line numbers

Post by bbalmerTotalFluency » Sun Aug 22, 2021 3:49 am

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”