xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HexToStr()

Converts a Hex encoded character string to an ASCII string.

Syntax

HexToStr( <cHexString> ) --> cASCIIstring

Arguments

<cHexString>
This is a character string holding ASCII values in hexadecimal format.

Return

The function returns the decoded Hex string as a character string in ASCII format.

Description

HexToStr() converts a Hex formatted character string to a character string in ASCII format. It converts only characters in the range from "0-9" and "a-f" or "A-F". If <cHexString> contains any other character, the conversion is stopped. The reverse function is StrToHex().

Info

See also:CStr(), HexToNum(), NumToHex(), StrToHex(), Transform()
Category: Character functions , Conversion functions , xHarbour extensions
Source:rtl\hbhex2n.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates return values of HexToStr()

    PROCEDURE Main
       LOCAL cString1 := "48656C6C6F"
       LOCAL cString2 := "576F726C64"

       ? HexToSTr( cString1 )   // result: Hello

       ? HexToSTr( cString2 )   // result: World
    RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe