stringAsInt()

The system function mathLib.stringAsInt accepts a character value (like "98") and returns the equivalent value as a BIGINT type. If the input is nonnumeric, the function returns a null value.

If the character value to be converted is null or blank, the return value depends on the value of the I4GLItemsNullable property (see i4glItemsNullable). If I4GLItemsNullable is set to YES, the function returns a null value; otherwise the function returns 0. This behavior is the reason to use mathLib.stringAsDecimal rather than making a simple assignment (see Assignments). If you assign a blank value to a BIGINT variable, EGL will throw an exception.

  mathLib.stringAsInt(numberAsText STRING in)
  returns (result BIGINT nullable)
numberAsText
A character field or literal string, which can include an initial sign character.
result
A field that can accept a BIGINT value. The receiving field must be nullable.

Example

  myField = "-5";

  // result = -5
  result = mathLib.stringAsInt(myField);  

Feedback