String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands >

String Operations

CHR. - Get Character

Previous Top Next


MiniRobotLanguage (MRL)

 

CHR. Command

Get Character

 

 

Intention

 

This command can be used to get the String-Character for a one or more specified ASCII-Codes. Usage is easy.

 

CHR.$$INP|$$OUT

 

 

 

 

 

Syntax

 

 

CHR. [P1][|P2[|P3]

 

 

Parameter Explanation

 

If 3 Parameters are used, the command will put a sequence (P1 to P3) into P2.

 

 

P1 - Input-Parameter, if omitted TOS is taken

P2 - Output-variable, if omitted TOS is taken

P3 - optional. If given all CHR(P1 to P3) are filled into VAR in P2

 

 

 

Example

 

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

' CHR.-DEMO

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

'DBM.2

PRT.-------------------------

' We work from Stack to Stack if no

' Parameters are specified.

VAN.§§NUM=65

PUV.§§NUM

DMP.4

CHR.

PRT.We get the letter A: >$$000<

PRT.-------------------------

' We work from Variable to Stack if one

' Parameters is specified.

: §§TXT=66

CHR.§§TXT

PRT.We get the letter B: >$$000<

PRT.-------------------------

' We work from Variable to Variable if two

' Parameters are specified.

: §§TXT=67

CHR.§§TXT|§§LFN

PRT.We get the letter C >§§LFN<

PRT.-------------------------

' We work from Variable to Variable and use third

' parameter to generate a sequence of ASC-Chars.

' The Chars from 65 to &8 will be put into §§LFN.

: §§TXT=65

: §§IND=68

CHR.§§TXT|§§LFN|§§IND

PRT.We get the letters from A to D >§§LFN<

PRT.-------------------------

END.

 

 

 

Remarks

 

Parameters are range-checked. Numbers lower then 0 will be set to 0, numbers higher then 255 will be set to 255.

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    ASC. - Get ASCII - Code

    GSS. - GetSplitString

    ! STR. - String Command

 

      ASCI-Codes (WEB-Link)