Asked — Edited
The last couple of days I have been struggling with Elseif's which do not appear to be recognized by ARC (latest version) as an Elseif but rather as an If in the structure as can be seen below:-
This of course is just an example template to illustrate the issue. If I replace the
statements instead with an endif / if combination the structure appears fine, it is only when I introduce an elseif into the equation that the structure fails.
I have only noticed this problem since upgrading to Windows 10, and the code appears to run OK.
Actual code that exhibits this behavior also appears below:
if ($autonomous = true)
if ($isStanding = true)
ControlCommand("Auto Position", AutoPositionAction, "Thinking")
ControlCommand("Auto Position", AutoPositionAction, "Bow")
SleepRandom( 5000, 20000 )
The only reason for the
statement is that I read EZ-Script does not like there to be no statements in between an If/EndIf pair.
Has anyone experienced similar before, and what could be going on here? This has occurred with multiple scripts I have written over the last 2 days and persists between saves or even if the code is pasted into a new script.
Upgrade to ARC Pro
ARC Early Access will give you immediate updates and new features needed to unleash your robot's potential!
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
I would check that you don't have the variable being used somewhere else in another script.
If you press FORMAT CODE button, that is how the compiler parses the conditions.
However if I try any combination of the original script I pasted, then the bracketed indicators to the left of the line numbers show an imbalance of if/endif's once elseif is introduced.
Anyway, I guess the most important thing is that the script itself runs OK, it's just I am rather pedantic about things looking correct. Thanks for the assistance.
Incidentally I see I stupidly added pauses instead of sleeps in the sample code I pasted, I have since corrected that and pressed FORMAT CODE without any change to the original issue.
you're good to go