Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Thu Nov 23, 2017 11:31 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: hex to ascii
PostPosted: Tue Apr 18, 2006 7:24 am 
Is there anything built-in that will convert hex to ascii? I noticed char is a reserved keyword but connot find any documentation on it.


Top
  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 3:16 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
The function _formatHexToInt is included with Qlarity Foundry 2.40 or higher and can convert a string of hex characters to an integer. An integer is castable to a byte that can be put into an existing string.



Code:

dim s as string



redim(s, 1)

s[0] := _formatHexToInt("0x4D")





The char, and charstr datatypes can be either bytes or unibytes depending on your configuration of Qlarity Foundry. If you have enabled unicode support under the tools->settings->compile then all char, and charstr datatypes will be 16bit unibytes otherwise they are the same as 8bit bytes or strings in Qlarity.



Code:

dim s as charstr



redim(s, 1)

s[0] := _formatHexToInt("4D")


_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group