2.6.4.25. execute_GetLongValue()

[<<<] [>>>]

Use this function whenever you want to access the @b{value} of a variable as a long. Formerly ScriptBasic in such situation converted the variable to long calling @xref{execute_Convert2Long()} and then used the macro LONGVALUE. This method is faster because this does not create a new mortal variable but returns directly the long value.

The macro GETLONGVALUE can be used to call this function with the default execution environment variable pEo

Note however that the macro GETLONGVALUE and LONGVALUE are not interchangeable. GETLONGVALUE is returnig a long while LONGVALUE is a left value available to store a long.

long execute_GetLongValue(pExecuteObject pEo,
                          pFixSizeMemoryObject pVar
  ){

Please also note that the result of converting a string variable to LONG and then accessing its longvalue may not result the same number as calling this function. The reason is that conversion of a string to a LONG variable is done in two steps. First it converts the string to a double and then it rounds the double value to long. On the other hand this function converts a string diretly to long.

For example the string "3.7" becomes 4 when converted to long and 3 when getting the value as a long.


[<<<] [>>>]