StringToHex (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 19: Line 19:
                                                                                                          
                                                                                                          
The following statement displays ''''D581A8A281A88599'''':                                               
The following statement displays ''''D581A8A281A88599'''':                                               
     [[PrintText Statement|printText]] {'Naysayer':stringToHex}                                        
     [[PrintText statement|printText]] {'Naysayer':stringToHex}
                                                                                                       
 
===See also===                                                                                           
===See also===                                                                                           
[[List of Intrinsic String Methods]]
[[List of Intrinsic String Methods]]

Revision as of 14:01, 11 October 2010

This intrinsic function returns the hex encoded value of the method object string.

StringToHex is available as of version 7.2 of the Sirius Mods.

StringToHex syntax

  %outStr = string:StringToHex                                                                         

Syntax Terms

%outStr
A string variable to receive the hex encoded value of the method object string.
string
The string to be hex encoded.

Usage Notes

  • Hex (short for hexadecimal) encoding is usually used for debugging when there is a concern that non-displayable characters (including trailing blanks) might be present in a string. By hex encoding such a string, all non-displayable bytes are converted to displayable hexadecimal equivalents.
  • The StringToHex function always returns an even number of bytes.
  • The inverse of StringToHex is HexToString.

Examples

The following statement displays 'D581A8A281A88599':

   printText {'Naysayer':stringToHex}

See also

List of Intrinsic String Methods