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

Content added Content deleted
m (→‎Classic Rexx(es): including latest Regina version(s).)
m (placed an ooRexx entry (which was in the wrong section) to the ooRexx section. REXX _is_ Classic REXX, ooRexx is ooRexx.)
Line 57: Line 57:


=={{header|ooRexx}}==
=={{header|ooRexx}}==
===version 1===
<lang oorexx>/*REXX program determines what characters are valid for REXX symbols.*/
<lang oorexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* copied/adjusted from REXX */
/* copied/adjusted from REXX */
Line 69: Line 70:
<pre>
<pre>
symbol characters: !.0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz </pre>
symbol characters: !.0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz </pre>

===version 2===
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* above program adapted for ooRexx (without using any oo feature */
Parse Version v
Say v
symbol_characters='' /* start with no chars */
do j=0 To 255 /* loop through all the chars.*/
c=d2c(j) /* convert number to character*/
if datatype(c,'S') then /* Symbol char */
symbol_characters=symbol_characters || c /* add to list. */
end
say 'symbol characters:' symbol_characters /*display all */
</lang>
{{out}}
Note that $#@ are no longer valid symbol characters.
<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}}==
Line 119: Line 138:


=={{header|REXX}}==
=={{header|REXX}}==
===Classic Rexx(es)===
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
@='' /*set symbol characters " " */
@='' /*set symbol characters " " */
Line 152: Line 170:
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ
</pre>
</pre>

===ooRexx===
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* above program adapted for ooRexx (without using any oo feature */
Parse Version v
Say v
symbol_characters='' /* start with no chars */
do j=0 To 255 /* loop through all the chars.*/
c=d2c(j) /* convert number to character*/
if datatype(c,'S') then /* Symbol char */
symbol_characters=symbol_characters || c /* add to list. */
end
say 'symbol characters:' symbol_characters /*display all */
</lang>
{{out}}
Note that $#@ are no longer valid symbol characters.
<pre>REXX-ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014
symbol characters: !.0123456789?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Tcl}}==
=={{header|Tcl}}==