End Repeat/repeatuntil/repeatwhile

 
#1

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?

#2

Hi larschrjensen,

I loaded the Example Project file included in the EZ-Builder 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 EZ-Builder 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.

#3

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.

#4

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