1.6.23. Convert a value to other type

[<<<] [>>>]

CONVERT2DOUBLE(x)
CONVERT2LONG(x)
CONVERT2STRING(x)

Use these macros to convert a value to long, double or string. The macros return the pointer to the converted type. Note that conversion between long and double does not generate a new value. In such a conversion the argument pointer is returned and the value itself is converted from one type tp the other. This was programmed this way to avoid unneccesary creation of mortal values. However be sure that either the argument is a mortal value or you do not mind the conversion of the value and so the value of the variable that the value was assigned to. You need not worry about this when you use the macro EVALUATEEXPRESSION and not _EVALUATEEXPRESSION.

Also note that a conversion does not duplicate the value if the value already has the desired type. In such a case the argument pointer is returned.

On the other hand there is no guarantee that the conversion is done in-place. When conversion from string to anything else is done a new mortal variable is allocated and the pointer to that value is returned.


[<<<] [>>>]