SQL layout on different lines

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hrcap
Posts: 131
Joined: Mon Jan 14, 2019 5:20 pm

SQL layout on different lines

Post by hrcap » Tue Jan 22, 2019 4:35 pm

Hi All

I am currently putting together some SQL statements and am having to lay them out on a single line, e.g.

put "account_create, timestamp_create, timestamp_create_utc, account_mod, timestamp_mod, timestamp_mod_utc, _kp_uuid_username, email_user, date_of_birth, password_hint, password, username" into tFields


is there a way to allow this to be set out on separate lines (which i find easier to read), e.g.

put "
account_create,
timestamp_create,
timestamp_create_utc,
account_mod,
timestamp_mod,
timestamp_mod_utc,
kp_uuid_username,
email_user, date_of_birth,
password_hint,
password,
username"
into tFields


Many Thanks

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: SQL layout on different lines

Post by bogs » Tue Jan 22, 2019 4:49 pm

hrcap wrote:
Tue Jan 22, 2019 4:35 pm
is there a way to allow this to be set out on separate lines
Well, the line continuation character comes to mind. Alternately, as Devin pointed out in the bottom of that page, you can store the meat of the query in a list box or cust. property or whatever you like really, then just call it.
Image

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: SQL layout on different lines

Post by MaxV » Wed Jan 23, 2019 1:56 pm

Try this

Code: Select all

replace "," with (comma & return) in tFields
See also: https://livecode.wikia.com/wiki/Replace
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: SQL layout on different lines

Post by bogs » Wed Jan 23, 2019 2:12 pm

Hm, I'm pretty sure he means in the script editor Max.

In case you don't mean the script editor hrcap, Max's line will take

Code: Select all

 "account_create, timestamp_create, timestamp_create_utc, account_mod, timestamp_mod, timestamp_mod_utc, _kp_uuid_username, email_user, date_of_birth, password_hint, password, username"
 
and put it like this in a field

Code: Select all

account_create,
timestamp_create,
timestamp_create_utc,
account_mod,
timestamp_mod,
timestamp_mod_utc,
kp_uuid_username,
email_user, date_of_birth,
password_hint,
password,
username"
Image

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”