repeat with ....

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
RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

repeat with ....

Post by RossG » Fri Jul 07, 2017 3:11 am

I recall that I asked this question previously but can't
find the answer...

Repeat with a long line of field names so want to separate into
shorter lines. It requires a "/" but is it ...name,name," / ?

Haven't been able to get the right combination (again).
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10328
Joined: Wed May 06, 2009 2:28 pm

Re: repeat with ....

Post by dunbarx » Fri Jul 07, 2017 4:37 am

Hi.

Not sure at all what you are asking. Are you taking about a repeat loop or separating lines in the script editor?

Can you rephrase?

Craig Newman

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

Re: repeat with ....

Post by bogs » Fri Jul 07, 2017 8:12 am

The way I read the question, what your looking for is to separate lines into shorter lines. In that case, the slash you have in the question is the wrong one.

From the dictionary:
The character \ is used to break a line in a script for display, while still having it treated as a single statement.

Examples:
answer "You've been waiting for" numberOfMinutes \
"minutes." with "Keep Waiting" or "Cancel"
As for loosing previous questions you asked, you can always go to your user control panel to view previous posts you made, or alternately, go to advanced search and type your user name in the 2nd box, all your posts should come up :)

*Edit - in the case of your remembering a previous post, the advanced search/your name gave me this with no other search terms, on page 11.
Image

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: repeat with ....

Post by RossG » Sat Jul 08, 2017 12:16 am

Thanks bogs.

Did search my previous post without success.
I think it may have been a subsidiary question
in a post not related to this question.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

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

Re: repeat with ....

Post by [-hh] » Sat Jul 08, 2017 8:26 am

@RossG. You are looking for the line continuation char backslash ("\").

An example for a string:

Code: Select all

"part 1 of string, part 2 of string"
is the same as

Code: Select all

"part 1 of string, " & \ 
"part 2 of string"
@bogs. You forgot in your example twice the concatenation "&" (and the space).
bogs wrote:answer "You've been waiting for" numberOfMinutes \
"minutes." with "Keep Waiting" or "Cancel"
The above should read:

Code: Select all

answer "You've been waiting for " & numberOfMinutes & \
       " minutes." with "Keep Waiting" or "Cancel"
shiftLock happens

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

Re: repeat with ....

Post by bogs » Sat Jul 08, 2017 5:55 pm

Ross, happy I could help :) You will often find this stuff in the dictionary quickly even if you put the wrong character in initially, for instance "/"
would have brought up division, tipping you reversing it would be the likely answer. Just make sure to read the whole page, as -hh points out ....

Heya -hh :)
Good catch, but it was not my example.

Image

However, I didn't read the whole page,and I probably should have !

Image

As -hh and the comment at the bottom of the page correctly point out, concatenation is required. My apologies for posting too quickly :oops:
Image

Post Reply