
Sulla
USA
Asked
— Edited
Just curios if there is a step by step guide on using variables and arrays in this scripting language?
Just curios if there is a step by step guide on using variables and arrays in this scripting language?
To set a variable, you use:
Code:
A variable must be assigned something before you call it in the script.
To make an If statement using a variable, you need to compare the variable to either a set value or a sensor value.
Code:
Every script command has an explanation about it in the script manual.
As technopro pointed out, you can assign strings and numbers. Those are primitive elements of computers.
Number
A number is not a character found in words. A number includes one of the following digits only: 0 1 2 3 4 5 6 7 8 9 .
*Note i included the period (.) because it is an attribute to a number.
When assigning a number to a variable, you do it like this...
Code:
Strings (words)
Strings are words, such as you are reading or will find in the dictionary. A string is words wrapped in quotes. A quote is this character ". The reason strings require quotes, is to tell the computer where the string begins, and where the string ends. This differs from a number, because a number does not have spaces.
Here is an example of assigning a string to a variable
Code:
Use the EXAMPLES folder included in ARC to view examples of programming concepts. There is directions on finding the Examples folder in the activities tutorial: http://www.ez-robot.com/Tutorials/Course/6
Also, follow the activities tutorials and variables and IF conditions and and and are all included.
Here's an example you can play with as well
1) Load ARC
2) Add an EZ-Script control (Add Control -> Scripting -> EZ-Script)
3) Press Config and paste this code
Code:
run that
also, you can do this
Code:
or this
Code:
Already covered. See below.
@Sulla.
As well as the information posted above, these tutorials might be of use to you...
Explanation and Uses of Arrays Tutorial
Setting and using variables in step 4 of this Tutorial.
Also your first link is incorrect. Here'e the proper link:
Explanation and uses of Arrays Tutorial:
www.ez-robot.com/Tutorials/UserTutorials/166/1
(Link fixed).
There are A LOT of tutorials for EZ-Script on that page