Description

Data can be converted in three ways:

nShortVar = dwDWordVar

 

In ATEasy any numeric type can be assigned to any other numeric type (including Char and WChar). In addition, String and BString can be also assigned. Variant can be assigned to/from a numeric, String, BString, Array or even a Struct. Assigning a Struct to a Variant will cause the variant to be converted to array of variants were each field is an array element of type Variant.   

As a new feature in ATEasy 5.0, ATEasy allows character data conversion through assignment; namely, a byte or char array can assign to String or vise versa. For example, if aByteArray is an array of bytes of size 10, aCharArray is an array of characters of size 10, and sString is of type String, the following assignments are allowed:

 

sString="abc"

sByteArray=sString    ! now aByteArray contains "abc"
 

sString="test string"

aCharArray=sString    ! now aCharArray contains "test strin" - only 10 characters copied

 

If the size of array is shorter than the string length, the string will be truncated. Notice only 10 characters are copied in the second example above.

ProcedureA(dDouble,...)

and you call it with:

ProcedureA(17,...)

the argument value of 17 will be converted to the Double ( 8-byte real ) value of 17.0 and assigned the parameter dDouble..

Variables Declaration

Unlike Visual Basic, in ATEasy, you must declare a variable before you can use it. In addition, ATEasy is a "typed" language, meaning there are rules for passing data from one type to another type.

Operators/Operands

Data conversions occur in an expression on an operator/operand basis. An "operand" is the entity which an "operator" acts upon, in an expression. For example, in the following:

If (A = B )

the equal sign is the operator while A and B are the operands.

The conversions depend on the specific operator and the type of the operand(s). As an expression is evaluated in ATEasy, if the data types of the two operands are different, a data conversion will occur.

See Also

Variable Naming Conventions