Advanced Javascript
Variable dependencies, interval expressions, and numeric calculations are written using JavaScript.
...
Executing code based on a condition can be performed using if and if / else statements.
If Statement Syntax (VarCode = a StudyTRAX Variable's Code)
if (#VarCode1 == 0) {
#VarCode2 = 1;
Other statements here...
}
If - Else Statement Syntax (VarCode = a StudyTRAX Variable's Code)
if (#VarCode1 == 0) {
#VarCode2 = 1;
} else if (#VarCode1 == 1) {
#VarCode2 = 2;
} else if (#VarCode1 == 2) {
#VarCode2 = 3;
} else {
#VarCode2 = 0;
}
Functions are defined on the Dependencies tab (see image). The standard way to set up functions is:
- In the Expressions box type the text "main()"
- In the User Defined Functions box type the text "function main()" and then type out the function
- Don't include the quotes from the text main() and function main() above