Migrating from EZ-Script to JavaScript

Semicolon Line Endings

When writing EZ-Script code, at the end of the line you simply press <enter> and start coding on the next line. However, in JavaScript, it is recommended to terminate the line with a semicolon ; character. With the ARC JavaScript compiler, it is not mandatory to do it, but you will find most code examples will have the semicolon at the end of the line.

Examples

EZ-Script Example

print("This is some text")
print("This is another line of text")

JavaScript Example

print("This is some text");
print("This is another line of text");

*Note: Notice the semicolon at the end of the lines in JavaScript. Again, it's not mandatory, but it is recommended for proper JavaScript compliance.

Why Semicolons?

Traditionally, a semicolon has been common across many programming languages to tell the compiler the end of the command. This is because many commands can be included on the same line with JavaScript. It is not recommended to do this because it is messy to read, but some people program this way.

Example Of Many Commands On One Line

print("Hello"); print("World");

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

#1  

Wow that is totally great info to know, thanks!

#2  

Thanks for this Tutorial @DJ. It will be invaluable as I change over my many scripts from EZ Script to JavaScript! I'm excited to see how my robot's arm servo react to the new faster language. I have some pretty complex scripts (for me anyway. LOL).

PRO
Synthiam
#3  

I think you'll find that the new scripts you write will be even smaller and faster. Probably easier to read as well. I can always help you change some over if you post one. That'll give you examples of how the difference would be.

#4   — Edited

But just to be clear, the EZ scripts should still mostly work in Arc? I tried 2 that still worked no conversion. Just slower most likely.

PRO
Synthiam
#5  

Yeah, EZ-Script works in ARC. This is a tutorial to help people migrate to a faster and more feature-rich language.

#6  

Wow @DJ. That's an amazing offer. Thanks! I'll post one soon. I think I have covid now and need to get past that first. Can't quite thing straight right now. LOL.

PRO
Synthiam
#7  

Oh boy, it seems everyone is getting covid these days. I'm feeling left out. I hope you're doing well and binge-watching a lot of tv! Drink soup and dream about robots.

#8  

Thanks DJ. I'm coming to the end of it I hope. Feeling better. Don't feel left out. Only good thing about this is now I have some antibodies for a while. LOL. Stay healthy!