TOS

Concept Link IconSee also

Convert a number to a SINGLE value.

WebVue support - Yes.

Syntax

SngVal = TOS(Num);

Return type: SINGLE.

Argument

Meaning

Num

The number to be converted. Any numeric type.

Execution

The number SngVal is converted to a SINGLE value.

TOS is equivalent to TOD if the property Use register variables as double in SCADA BASIC script has been selected (Configure.Application Explorer.Settings.Advanced.Programs). This avoids a problem with precision when using register variables of type DOUBLE.

Example

SUB Main()

DIM lngValue as Long;

DIM sngResult as Single;

 

lngValue = 125;

sngResult = TOS( lngValue );

PRINT("Result: ", sngResult);

'Display "Result: 125"

END SUB