Anonymous user
Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Idiomatically determine all the characters that can be used for symbols (view source)
Revision as of 19:21, 11 September 2014
, 9 years agoplaced an ooRexx entry (which was in the wrong section) to the ooRexx section. REXX _is_ Classic REXX, ooRexx is ooRexx.
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:
=={{header|ooRexx}}==
===version 1===
<lang oorexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* copied/adjusted from REXX */
Line 69 ⟶ 70:
<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}}==
Line 119 ⟶ 138:
=={{header|REXX}}==
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
@='' /*set symbol characters " " */
Line 152 ⟶ 170:
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ
</pre>
▲<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}}==
|