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

AVEVA™ Plant SCADA

StrToHex

  • Last UpdatedJul 18, 2023
  • 1 minute read

Converts a hexadecimal string into an integer. This function will search the string for the first non-blank character, and then start converting until it finds the end of the string or a non-hexadecimal numeric character. If the first non-blank character is not one of the following hexadecimal characters, the return value is 0 (zero):

  • (0-9, a-f, A-F);

  • A space;

  • A"+" (plus) or a "-" (minus) sign.

Syntax

StrToHex(String)

String:

The string to convert.

Return Value

An integer (converted from String).

StrToReal, StrToValue, HexToStr

Example

Variable=StrToHex("123");

! Sets Variable to hex 123, decimal 291

Variable=StrToHex("F2");

! Sets Variable to hex F2, decimal 242

Variable=StrToHex("G45");

! Sets Variable to 0.

Variable=StrToHex("-FG");

! Sets Variable to hex, -F decimal -15.

See Also

String Functions

Using the Caret Escape Sequence Character

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