IBM Support

How to convert a number to a hexadecimal value

Troubleshooting


Problem

SQABasic does not contain any numeric data types that can be expressed as hexadecimal values. This tech note explains how to convert a number to a hexadecimal value.

Resolving The Problem

Use the hex command to convert a numeric value to a hexadecimal value. The following script shows an example of how to use the hex command

Sub main


    Dim usernum as Integer

    Dim hexvalue

    usernum=InputBox("Enter a number to convert to hexadecimal:")

    hexvalue=Hex(usernum)

    MsgBox "The HEX value is: " & hexvalue


End Sub



[{"Product":{"code":"SSSHDX","label":"Rational Robot"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Scripting","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2001a;2001a.04.00;2002;2002.05.00;2002 Release 2;2002.05.20;2003;2003.06.00;2003.06.12","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

20468

Document Information

Modified date:
16 June 2018

UID

swg21133995