Jump to content

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

reinstated version 2 of a REXX program (suitable for ooRexx)
(→‎version 2: reoved)
(reinstated version 2 of a REXX program (suitable for ooRexx))
Line 66:
 
=={{header|ooRexx}}==
===version 1===
<lang oorexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* copied/adjusted from REXX */
Line 129 ⟶ 128:
 
=={{header|REXX}}==
===version 1===
<lang rexx>/*REXX program determines what characters are valid for REXX symbols. */
@= /*set symbol characters " " */
Line 161:
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ
</pre>
===version 2===
This is to show what ooRexx' result is for this REXX program. Cf. the ooRexx section.
<lang rexx>/*REXX program determines what characters are valid for REXX symbols.*/
/* version 1adapted 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}}==
2,300

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.