basic.%memxcpy
Copies memory and converts to hexadecimal.
Syntax
variable=(char*)%memxcpy(s1, s2, number )
Description
copies 'number/2' characters from memory area 's2' into 's1', and converts each input character into two ASCII hexadecimal characters '0' to '9' and 'A' to 'F'.
's1' and 's2' are either Pick/BASIC strings or pointers to a character. 'variable' is a pointer after the last converted character in 's2' . If 's2' is a Pick string, the value returned by this function has no meaning.
Example
* Obtain Unix space
ptr=(char*)%malloc( 2048 )
* Read from Unix file
n=%read( fd, (char*)ptr, 1024 )
* Convert the binary data into HEX ASCII
char buffer[2048]
%memxcpy( buffer, (char*)ptr, n*2 )
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
