Appendix
Operators
This section describes the traditional operators (e.g., + - * /) you can use in ProvideX, along with other operators for which support has been added in recent versions
(e.g., the auto-increment and decrement operators, assignment operators, the LIKE Operator, and the Apostrophe Operator). Use of these operators is further described in the ProvideX User's Guide.
 
Arithmetic Operators
+ Where A + B adds A to B.
 
- Where A - B subtracts B from A.
 
* Where A * B multiplies A by B.
 
/ Where A / B divides A by B.
 
^ Where A ^ B raises A to the power of B (** is equivalent to ^).
 
| Where A | B divides A's remainder by B.
 
Assignment Operators The following assignment operators are included in the general syntax of the language:
  += Add to. Can be used with numerics or strings: Numeric example: A+=1is the same as A=A+1.
  String example: A$+="G"is the same as A$=A$+"G".
-= Subtract from. Not valid for strings.
 
  Numeric only: B-=A+1is the same as B=B-(A+1).
  -= Multiply by. Can be used with numerics or strings. Numeric example: B*=A+1is the same as B=B*(A+1)
  String example: A$*=5is the same as A$=A$+A$+A$+A$+A$.
/= Divide by. Not valid with strings.
 
  Numeric only: B/=A+1is the same as B=B/(A+1).
  ^= Exponentiation. Raise to. Not valid with strings. Numeric only: B^=A is the same as B=B^A.
|= Modulus / remainder from division. Not valid with strings. Numeric only: B|=A is the same as B=MOD(B,A)
 
Auto Increment and Decrement
 
In addition to the assignment operators, there are decrement and increment features:
 
++ Auto-increment (pre-increment when prefixed to variable name, post-increment if suffixed); e.g., ++variable or variable++.
 
-- Auto-decrement (pre-decrement when prefixed to variable name, post-decrement if suffixed); e.g.,--variable or variable--.


*Note* If an error occurs during execution of your directive, no increment or decrement takes place. (This is true for both pre- and post- operations.) With pre-increment or decrement, the value returned is the value of the variable after the increment or decrement. With post-increment or decrement, the value returned is the value of the variable before the increment or decrement. After your directive is executed, your variable is incremented or decremented by 1.


Example:
 
A=0, Y$=""
READ (1,IND=A++,ERR=*NEXT)X$; Y$+=X$; GOTO *SAME
 
or
 
Y$+=RCD(1,IND=A++,ERR=*NEXT); GOTO *SAME
 
See also: Labels/Logical Statement References .
 
LIKE Operator Use the LIKE operator for string comparisons. The ProvideX default (with the 'TL' System Parameter set to OFF) is to take the string expression on the left and compare it to the string mask on the right. In the default mode, you can apply all the regular expression rules of the MSK( ) function to using the LIKE operator. Use the following format:
 
IF A$ LIKE "ABC" THEN ...
To make your conversions from Thoroughbred easier, set 'TL' to ON. With this parameter ON, the LIKE operator emulates the Thoroughbred matching of patterns. For more information, refer to the SET_PARAM Directive, the MSK( ) Function, and the 'TL' System Parameter.
 
Apostrophe Operator The apostrophe operator is used to assign, retrieve, list, and make dynamic changes to a given control or object's properties. For details on the syntax and use of the apostrophe, refer to the Apostrophe Operator, below.