Page 1 of 1

Problem

Posted: Tue Nov 15, 2016 12:25 pm
by Michaellad
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?

Re: Problem

Posted: Tue Nov 15, 2016 2:43 pm
by shaosean
Can you post your code that is causing the error?

Re: Problem

Posted: Tue Nov 15, 2016 5:20 pm
by Klaus
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

Re: Problem

Posted: Wed Nov 16, 2016 10:02 am
by MaxV
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

Re: Problem

Posted: Wed Nov 16, 2016 11:13 am
by shaosean
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?

Re: Problem

Posted: Wed Nov 16, 2016 11:22 am
by Klaus
??? :shock:

MaxV <> Michaellad (the threadstarter)

Re: Problem

Posted: Wed Nov 16, 2016 11:59 am
by SparkOut
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.

Re: Problem

Posted: Wed Nov 16, 2016 1:02 pm
by MaxV
Klaus wrote:??? :shock:

MaxV <> Michaellad (the threadstarter)
I just furnished a repeat example.

Re: Problem

Posted: Wed Nov 16, 2016 2:05 pm
by Klaus
I know, tell it Sean! :D

Re: Problem

Posted: Wed Nov 16, 2016 2:30 pm
by shaosean
i don't really pay that much attention ;-)

Re: Problem

Posted: Wed Nov 16, 2016 5:01 pm
by dunbarx
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