Forget the comma thread. Now lose semicolons

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Forget the comma thread. Now lose semicolons

Post by [-hh] » Thu Jun 29, 2017 11:36 pm

Hi Craig, wizard of LC specials.

The secret here is that LC uses tokens to parse statements.
Token delimiters are semicolon, space, tab and return.

So, every sequence of valid statements delimited by one or several of these delimiters compiles and works.
Exception: After "mouseUp" (in general: a handler name) is a space allowed only if a parameter name follows.

For example put these two lines into a button's script to see it working:

Code: Select all

On mouseUp; put "a" into fld 1 put "b" into fld 2
do ("put 3 into fld 3"&tab&"put 4 into fld 4") end mouseUp
Kind regards, Hermann
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Forget the comma thread. Now lose semicolons

Post by dunbarx » Fri Jun 30, 2017 2:05 pm

Hello Hermann, master of precision, detail and formalism.

Or was that precision detail and formalism?

I understand tokens. I am still amazed that the spaces *within* a command phrase are properly parsed between the spaces *among* multiple command phrases.

Craig

Post Reply

Return to “Talking LiveCode”