Idiomatically determine all the characters that can be used for symbols: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: remover ooRexx Output from Version 1 and changed reasoning for Version 2)
(→‎{{header|ooRexx}}: copied REXX Version 2 here)
Line 66:
 
=={{header|ooRexx}}==
Although this program does not use any feature that is not in '''Classic''' Rexx,
<lang oorexx>/*REXX program determines what characters are valid for REXX symbols.*/
it is included here to show what characters are valid for symbols in ooRexx.
/* copied/adjusted from REXX */
a='' <lang oorexx/*setREXX program determines symbolwhat characters " are valid "for REXX symbols.*/
/* copied from REXX version 2 do j=0 for 2**8 /*traipse through all the chars. */
Parse Version v
_=d2c(j) /*convert decimal number to char.*/
Say v
if datatype(_,'S') then a=a || _ /*Symbol char? Then add to list.*/
symbol_characters='' end /*j*/ /* start with no chars /* [?] put some chars into a list*/
do j=0 To _=d2c(j) 255 /*convert decimalloop through numberall tothe charchars.*/
 
say ' c=d2c(j) symbol characters: ' a /*display allconvert number symbolto characters.character*/</lang>
if datatype(_c,'S') then a=a || _ /* Symbol char? Then add to list. */
{{out}}
symbol_characters=symbol_characters || c /* add to list. */
<pre>
end
symbol characters: !.0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz </pre>
say 'symbol characters:' symbol_characters /*display all */ {{out}}
<pre>REXX-ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014
symbol characters: !.0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz </pre>
 
=={{header|PARI/GP}}==