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: Line 66:


=={{header|ooRexx}}==
=={{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='' /*set symbol characters " " */
<lang oorexx/*REXX program determines what characters are valid for REXX symbols.*/
do j=0 for 2**8 /*traipse through all the chars. */
/* copied from REXX version 2 */
Parse Version v
_=d2c(j) /*convert decimal number to char.*/
Say v
if datatype(_,'S') then a=a || _ /*Symbol char? Then add to list.*/
end /*j*/ /* [?] put some chars into a list*/
symbol_characters='' /* start with no chars */
do j=0 To 255 /* loop through all the chars.*/

say ' symbol characters: ' a /*display all symbol characters.*/</lang>
c=d2c(j) /* convert number to character*/
if datatype(c,'S') then /* Symbol char */
{{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}}==
=={{header|PARI/GP}}==