Asked

Scripts Will Not Run From Previous Synthiam Version Software

I have tried to run both ARC 4.3 and ARC 4.5 with scripts from my previous Synthiam software.    I receive an error code that identifys a LOOP LABEL as not identified.  I have reidentified the LOOP and still indicates an error. I have performed multiple EZB4 resets and removed/reinstalled above software versions to include a computer retart. I am using widows 10 All scripts operated beautifully until I updated this morning.  I tried ARC 2 and problem remains. Any help? I'm desparate. Jack


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

PRO
Synthiam
#17   — Edited

Here's an example of using public (global) and private variables in a loop...

Notes:

  • notice how a public (Global) variable has a $ (dollar sign) at the beginning. A global public variable means it can be accessed by all scripts.
  • the variable "countThisIsNotPublic" does not start with a $ (dollar sign). Therefore, it only exists within this script. It cannot be accessible by other scripts.
  • see how the main code is within a "loop forever". That will loop for ever, as the name suggests. You can exit the loop with a BREAK. Or you can exit the entire script with a HALT or a RETURN

    User-inserted image

And here's the JavaScript it generates...


countThisIsNotPublic = 0;

while (true) {

  setVar("$MyGlobalVariable", Utility.getRandom(0, 10));if (getVar("$MyGlobalVariable") == 5) {

    print("The random number matched my number");
    break;
  }

  countThisIsNotPublic = (countThisIsNotPublic + 1);
}

print("Break got me here because it breaked out of the loop.");
print("It took " + countThisIsNotPublic + " times to guess my number with random");

#18  

Thanks a million, I think I'm back on track. Jack