...
- Adding a page break between variable groups to increase the speed as only the code on each page is executed (see the Layout tab on the Variable Group Update page).
- Utilizing local variables in place of repeating a condition with a StudyTRAX Variable Code.
- Implementing a global variable to track the current state, thus hiding or disabling will be executed only if the state changes. To implement a global variable, set the global variable before the main function.
Note A StudyTRAX variable cannot be used as a global variable before the main function.
Example
...
Examples
...
Utilize local variables
...
Info |
---|
It takes fewer operations to evaluate the value of a local variable than it takes to evaluate the value of a StudyTRAX variable |
Instead of: | Do: |
---|---|
#variable1.show(#myVar1==1); | var myResult = #myVar1==1 ? true : false; |
#variable11.show(#myVar2==1); | var myResult2=#myVar2; |
Utilize global variables
Info |
---|
A global variable can be used if a large number of variables are being hidden or disabled based on one condition |
...
Instead of: | Do: |
---|---|
function main() { | var areVarsShown=true; |