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

Post Reply
Michaellad
Posts: 12
Joined: Tue Nov 15, 2016 12:17 pm

Problem

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

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

Post by shaosean » Tue Nov 15, 2016 2:43 pm

Can you post your code that is causing the error?

Klaus
Posts: 13982
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem

Post by 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

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

Re: Problem

Post by 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: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

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

Klaus
Posts: 13982
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem

Post by Klaus » Wed Nov 16, 2016 11:22 am

??? :shock:

MaxV <> Michaellad (the threadstarter)

SparkOut
Posts: 2896
Joined: Sun Sep 23, 2007 4:58 pm

Re: Problem

Post by 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.

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

Re: Problem

Post by 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: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Klaus
Posts: 13982
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem

Post by Klaus » Wed Nov 16, 2016 2:05 pm

I know, tell it Sean! :D

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Problem

Post by shaosean » Wed Nov 16, 2016 2:30 pm

i don't really pay that much attention ;-)

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

Re: Problem

Post by 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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”