Problem

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Problem

Postby Michaellad » Tue Nov 15, 2016 12:25 pm

When I am trying to execute the code an error appears stating:

(Repeat: error in 'with' end condition expression)

I am unsure of what this means, could someone help?
Michaellad
 
Posts: 12
Joined: Tue Nov 15, 2016 12:17 pm

Re: Problem

Postby shaosean » Tue Nov 15, 2016 2:43 pm

Can you post your code that is causing the error?
shaosean
 
Posts: 797
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

Postby Klaus » Tue Nov 15, 2016 5:20 pm

Hi Michael,

1. welcome to the forum! :D
2. What Sean said, guessing is just too timeconsuming! 8)
3. Will move this thread to the "Beginners" forum.


Best

Klaus
Klaus
 
Posts: 9491
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Problem

Postby MaxV » Wed Nov 16, 2016 10:02 am

Repeat with example:

########CODE#######
repeat with i=1 to 10
answer i
end repeat
#####END OF CODE#####

Here more informations: http://livecode.wikia.com/wiki/Repeat
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w
MaxV
 
Posts: 1282
Joined: Tue May 28, 2013 2:20 pm
Location: Italy

Re: Problem

Postby shaosean » Wed Nov 16, 2016 11:13 am

Hi, thanks for the code sample.. That should work without an issue, so not too certain why the LiveCode engine is complaining.. What version are you using and what operating system?
shaosean
 
Posts: 797
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

Postby Klaus » Wed Nov 16, 2016 11:22 am

??? :shock:

MaxV <> Michaellad (the threadstarter)
Klaus
 
Posts: 9491
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Problem

Postby SparkOut » Wed Nov 16, 2016 11:59 am

Typical new user mistake:

Code: Select all
repeat with each line tLine of tList -- will not work

Use
Code: Select all
repeat for each line tLine of tList
or use the "with" syntax Max shows above

If you don't need to have the specific numerical indexin the "with" syntax then repeat for each is much, much faster in the loop.
SparkOut
 
Posts: 1627
Joined: Sun Sep 23, 2007 4:58 pm

Re: Problem

Postby MaxV » Wed Nov 16, 2016 1:02 pm

Klaus wrote:??? :shock:

MaxV <> Michaellad (the threadstarter)


I just furnished a repeat example.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w
MaxV
 
Posts: 1282
Joined: Tue May 28, 2013 2:20 pm
Location: Italy

Re: Problem

Postby Klaus » Wed Nov 16, 2016 2:05 pm

I know, tell it Sean! :D
Klaus
 
Posts: 9491
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Problem

Postby shaosean » Wed Nov 16, 2016 2:30 pm

i don't really pay that much attention ;-)
shaosean
 
Posts: 797
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

Postby dunbarx » Wed Nov 16, 2016 5:01 pm

Hmmm.

Never saw this error before. If one does this, as per SparkOut's suggestion:
Code: Select all
on mouseUp
   repeat with each word tWord in "aa bb cc" --note "with", not "for"
      put tword
   end repeat
end mouseUp


You get
compilation error at line 2 (repeat: expecting '=') near "word", char 16


and not
error in 'with' end condition expression)


But why speculate? Hey Michaellad, where are you?

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


Return to Getting Started with LiveCode - Complete Beginners

Who is online

Users browsing this forum: Google Feedfetcher and 4 guests