Assign values to variables and add them together:
// assign the value 5 to x and define x as decimal value
dec x=5
// assign the value 2 to y
dec y=2
// assign the value 7 to z (x + y)
dec z
z=<x>+<y>
Wrong:
dec z=<x>+<y>
The assignment operator (=) assigns a value to a variable.
Assignment
dec x
x=10
The addition operator (+) adds numbers:
Adding
dec x,y,z
x=2
y=3
z=<x> * <y>
The multiplication operator (*) multiplies numbers.
Multiplying
dec x,y,z
x=2
y=3
z=<x> * <y>
BeasScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic on numbers:
Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
Arithmetic operators are fully described in datawindow expression
BeasScript String Operators
For Strings and all other formats operators are not available.
The system adds all placeholders
Example
string txt1,txt2,txt3
txt1=Martin
txt2=Doe
txt3=<txt1> <txt2>
messagebox=<txt3>
// Return: John Doe
Alternative variant is setvar.
setvar=txt1=Martin
setvar=txt2=Doe
setvar=txt3=<txt1> <txt2>
messagebox=<txt3>