Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Shorten simple if statements

Instead of:

Do:

var myResult;
if (#var1==1) myResult=true;
else myResult=false;

var myResult = #var1==1 ? true : false;



Shorten assignment operators

Note: the following examples assume local variables, if using a StudyTRAX variable precede the variable code with a 3.

Operator

Shortcut

myCount = myCount + 1;

myCount++;

myCount = myCount - 1;

myCount--;

var1 = var1 + var2;

var1+=#var2;

var1 = var1 - var2;

var1-=#var2;

var1 = var1 * var2;

var1*=var2;

var1 = var1 / var2;

var1/=var2;

  • No labels