Hex()

Syntax

Result$ = Hex(Value.q [, Type])
Description
Convert a quad numeric number into a string, in hexadecimal format.

Example:


  Debug Hex(12) ; Will dipslay "C"
  Debug Hex(1234567890) ; Will display "0499602D2"

Note: If leading zero are needed in the output string, use the RSet() function as follows:

  Debug RSet(Hex(12), 4, "0") ; Will display "000C"


The optional parameter 'Type' may be used, if the 'Value' should be treated as another type.

'Type' may be:
  #PB_Byte   : The value is a byte number, ranging from 0 to 255
  #PB_Ascii  : The value is a ascii character, ranging from 0 to 255
  #PB_Word   : The value is a word number, ranging from 0 to 65536
  #PB_Unicode: The value is a unicode character, ranging from 0 to 65536
  #PB_Long   : The value is a long number, ranging from 0 to 4294967296
  #PB_Quad   : The value is a quad number, ranging from 0 to 18446744073709551615

Example:


  Debug Hex(-1)
  Debug Hex(-1, #PB_Byte)
  Debug Hex(-1, #PB_Word)
  Debug Hex(-1, #PB_Long)
  Debug Hex(-1, #PB_Quad)    ; quad value is the standard

See also Str(), Val() and Bin().

Supported OS

All

<- FindString() - String Index - InsertString() ->