XenoGuard Documentation

To Number

Actions » Programming » String Operation » Conversion » To Number 

The action To Number converts a string number value to a signed or unsigned number and stores the converted string in Result of the result list. 

[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the String Operation node.
  3. In the Conversion node, select the To Number action.

Parameters:

The action has the following input parameters:


name Description
Source String The string to be converted to a number.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Allowed Values [Signed Number, Unsigned Number]
Start Index
The starting point for the string.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Index Offset The position of the string to be displaced.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Remove Length The length of character(s) to be removed.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Number Type The data type for the converted string.

Allowed Context Scope [Fixed]
Allowed Values[Signed Number, Unsigned Number]

Warning An exception occurs when the Start Index value is less than zero.

Results:

The action returns the following results:


name
description
Result Contains the converted string.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]

Example 1 (Modify a string value of a variable and added to another variable):

This example changes the string value of the local Quantity variable with Text as a data type to a signed number. The result of the conversion was then added to the local Stock Count variable with Number as a data type.  The result of adding the variables is then output via Write text.

See other string conversion operations:

To Lower
To Upper