String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !STR.- String Command >

String Operations

STR.FROM HEXASCI

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.FROM HEXASCI

String commands

 

 

Intention

 

To transfer binary data in written form, all "non-printable characters" like ASCII 12,13 and others need to be encoded in printable Form.

HEXASCII is a Format, which encodes ASC-Codes with their ASCII-value in Hexadecimal Format.

A -> 1E

B -> 30

etc.

STR.FROM HEXASCI will convert the HEXASCII-text that is contained in a variable, to the Original-Format. The result will be in the same variable or in a Target variable if given.

 

The command itself looks like this:

' $$SRC - Binary or Text-Data to convert to MIME

' $$TAR - MIME-Format Result

STR.FROM HEXASCI|$$SRC|$$TAR

 

The Result looks somehow like you see below.

Its a Screenshot from the Examples below (see Examples-Section).

 

graphic

 

As you can see the HEXASCII encoded Binary is 530 bytes long, while the original size was 265 bytes. That is generally 200% the size of the original size.

Therefore its less efficient then MIME Encoding,

 

This is the reverse command to STR.TO HEXASCI .

 

 

 

Syntax

 

STR.TO HEXASCI|P1[|P2]

 

 

Parameter Explanation

 

P1 - source variable. If P2 is missing then its also the destination variable

 

P2 - (optional) destination variable. If omitted the result is placed in the variable in P1.

 

 

 

Example

 

'*************************************

' STR.TO HEXASCI and

' STR.FROM HEXASCI

'*************************************

$$SRC=What happens with the + and / Characters in HEXASCII?

$$SRC=$$SRC$$SRC$$SRC$$SRC$$SRC

LEN.$$SRC|$$LEN

PRT.($$LEN)->$$SRC

STR.TO HEXASCI|$$SRC

LEN.$$SRC|$$LEN

PRT.($$LEN)->$$SRC

STR.FROM HEXASCI|$$SRC

LEN.$$SRC|$$LEN

PRT.($$LEN)->$$SRC

MBX.It works!

ENR.

 

'*************************************

' STR.TO HEXASCI and

' STR.FROM HEXASCI

'*************************************

$$SRC=What happens with the + and / Characters in HEXASCII?

$$SRC=$$SRC$$SRC$$SRC$$SRC

LEN.$$SRC|$$LEN

PRT.($$LEN)->$$SRC

STR.TO HEXASCI|$$SRC|$$TAR

LEN.$$TAR|$$LEN

PRT.($$LEN)->$$TAR

STR.FROM HEXASCI|$$TAR|$$ERG

LEN.$$ERG|$$LEN

PRT.($$LEN)->$$ERG

MBX.It works!

ENR.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

    1.5.2 Working with Text-Strings

    STR.TO HEXASCI

    STR.TO BASE64 URL

    STR.FROM BASE64 URL

    STR.TEXT TO MIME

    STR.MIME TO TEXT

    STR.GENERATE - Mode

    GEC. - Get Encryption

    GMD. - Get Message Digest

    SHA. - Safer Hash Algo

    VAR. - Variable Set Value/Clear

    RPL. - RePLace in String

    IVS. / NVS. - If-Variable-String

    GSS. - GetSplitString

    GFS. - Get-Filtered-String

    GES. - Get-Extracted-String

    LEN. - Length-of-String