Difference between revisions of "Get an ASCII character"

From ArcoWiki
Jump to: navigation, search
(Created page with "In order to '''get an ASCII character''' from a string it is necessary to use the command <code>CHR(num)</code>.<br/> It returns a string with the length of 1 char which conta...")
 
m (Links to existing pages added by LinkTitles bot.)
Line 1: Line 1:
In order to '''get an ASCII character''' from a string it is necessary to use the command <code>CHR(num)</code>.<br/>
+
In order to '''[[get an ASCII character]]''' from a string it is necessary to use the command <code>CHR(num)</code>.<br/>
 
It returns a string with the length of 1 char which contains the ASCII character corresponding to the numeric value of 'x' (1 to 255)
 
It returns a string with the length of 1 char which contains the ASCII character corresponding to the numeric value of 'x' (1 to 255)
  

Revision as of 12:31, 3 August 2016

In order to get an ASCII character from a string it is necessary to use the command CHR(num).
It returns a string with the length of 1 char which contains the ASCII character corresponding to the numeric value of 'x' (1 to 255)

$$ Example to print ALL the ASCII characters

DECL/CHAR,50,st
DECL/INTGR,ii
DISPLY/OFF
DISPLY/TERM,V(TEXT)
DO/ii,1,255
$$ Assign to the (ii) value the corresponding ASCII character
st=ASSIGN/CHR(ii)
st=ASSIGN/CONCAT(STR(ii),' ',st)
TEXT/OUTFIL,st
ENDDO