Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Val

  • Last UpdatedJul 18, 2023
  • 1 minute read

Converts a text string containing numeric characters to a numeric value. The Val function expects the argument Str to be a valid string expression. The Val function stops reading the string when it reaches a non numeric character.

Symbols such as dollar signs and commas are not recognized; however, radix prefixes for octal (&0) and hexadecimal (&H) are. Blanks, tabs and line feeds are stripped out from the return.

The Val function performs the opposite of the Str function, which converts a numeric value to a text string containing numeric characters.

Syntax

Val(Str)

Str:

A string or expression that can represent a valid text value.

Return Value

Returns the numeric value of a string of characters extracted from the Str provided in the argument.

Format | Hex | Oct| Str

Example

Dim vntVar ' declare result holder variable
vntVar = Val("65") ' returns 65
vntVar = Val("90 Main St.") ' returns 90
vntVar = Val("12+34+56") ' returns 12
vntVar = Val(" 12 34 56 ") ' returns 123456
vntVar = Val("&0FF") ' returns
vntVar = Val("Zoe") ' returns 0

In This Topic
TitleResults for “How to create a CRG?”Also Available in