Home      Downloads             Documentation      FAQ     

Documentation>ETP-Basic reference>Affectation

 

Affectation

 To affect a value to a variable, use the following syntax :

VariableName = expression

First, expression is evaluated, then it is affected to the variable. The only condition is that expression and variable must have the same type, at least in size (in bytes) ! Only strings can have different sizes (but they are always under 50 characters)

In expression, try not to put uneeded parentheses.

For example, for an integer expression, you can use integer terms or functions that returns an integer. Otherwise, you'll have a Type Mismatch error.

To affect a value to a string, this is the same thing. To concatenate, use the "&" operator.

Example :

Local str1 as String
Local str2 as String

Local together as String
str1 = "Hello "
str2 = "world !"
together = str1 & str2

So the string together contains "Hello world !"


Implicit declarations

When you make an affectation to an undeclared variable, the compiler will declare it and will return a message in the debug window.

Click here to learn more about implicit declaration.

 

Documentation>ETP-Basic reference>Affectation

     
    About ETP Contact Us