An "If()" function has the structure of:
If( condition, run this if the condition is true , run this if the condition is false )
An example would be
If( :sex == "F", Show("This is a Female") , Show("This is a Male") )
Now, where a "Glue" character comes into play, is if in the true or false sections, more than one statement needs to be executed, the statements need to be "Glued" together to show that the true or false section one complete item. So if both: Show("This is a Female") and Gender = "Female" needs to be executed you need to "Glue" the statements together
If( :sex == "F", Show("This is a Female"); Gender = "Female" , Show("This is a Male") )
In all honesty, you can ignore Glue() and be a very successful JSL programmer. So, if this confuses you, don't worry about it.
JSL is a functional language. That is, everything(ish) in JSL is a function. Some functions in JMP have operator forms.
For example, the function to assign a value to a variable is Assign(a, b), which assigns the value of b into a. There is an operator form of that using an = sign:
The function that puts expressions together into something that can be evaluated is Glue(), as in:
The operator form of Glue() is a semicolon (;), the following is the equivalent of the above:
Assign(a,b); Add(c, d)
In any programmming language you need constructs to make decisions. In JSL, as in other languages, these are condtional functions.
If() takes at least three arguments:
I find it easiest to understand If() by looking at it's prototype in the Formula Editor.
Notice the first "expr" there. That's the condition to be tested and it's the first argument. The second argument, the "then clause", is the expression that should be evaluated if the condition is true. The third argument is the "else clause," the expression to be evaluated if the condition isn't true.
Outside of the formula editor this looks like:
If( a == "some value", Show( "True" ), Show( "False" ) );
So, this tests the condition that a is equal to "some value" and shows "True" if it is and "False" if it isn't.
Each of the clauses can contain multiple statements, separated by semicolons (;).
I hope this helps clear up some confusion.
If you've got more questions, let us know.