Asked — Edited

End Repeat/Repeatuntil/Repeatwhile

I was going through different types of loops in EZ-Script and noticed that the help text mentioned that repeatwhile loops should be ended with endrepeatwhile, but in the examples that are given for repeatuntil, repeatwhile and repeat all are ended with endrepeat. I also couldn't notice any difference when ending loops with endrepeat rather than endrepeatwhile. So do the extended endrepeats do anything that the basic endrepeat doesen't do?


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

#1  

Hi larschrjensen,

I loaded the Example Project file included in the ARC Examples named "Repeat" and the example scripts there show "endrepeatuntil" and so forth, while the Script Help still shows "ENDREPEAT" as the way to end any repeat.

I ran the example "Repeat Until" script unmodified and it worked of course. Then I changed then "endrepeatuntil" in line 8 to "endrepeat" and ARC debug displayed a message to me about the change:

>>Strange, compiling during SetConfig returned an error (old name: RepeatUntil, new name: RepeatUntil): System.Exception: Unable to find ENDREPEATUNTIL at level: 1 for line 1 at EZ_Builder.Scripting.Compiler.qTAmnKO8cE(Command[] , Int32 , Int32 ) at EZ_Builder.Scripting.Compiler.Compile(String script) at EZ_Builder.UCForms.FormScript.SetConfiguration(ConfigurationFormV2 cf) There are 1 controls named RepeatUntil

But the script did run correctly with "endrepeat".

This tell me the syntax for repeat was enhanced at some point and you SHOULD use the proper endrepeat clauses for the type of repeat that your are doing, whole the generic legacy "endrepeat" probably still works you should use the newer method.

And likely the ScriptHelp file is missing that syntax update.

PRO
Synthiam
#2  

Thanks for noticing - it's a simple misprint in the script help. Use the respective closing END_______ command for the opening REPEAT_____ command. I'll have the script manual updated.

#3  

Thanks for the responses @JustinRatliff and @DJ Sures. It makes sense then.