Idiomatically determine all the characters that can be used for symbols: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (→version 2: reoved) |
Walterpachl (talk | contribs) (reinstated version 2 of a REXX program (suitable for ooRexx)) |
||
Line 66: | Line 66: | ||
=={{header|ooRexx}}== |
=={{header|ooRexx}}== |
||
⚫ | |||
<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 129: | Line 128: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
⚫ | |||
<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 161: | Line 161: | ||
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ |
symbol characters: !#$.0123456789?@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£áíóúñÑ╡╢╖╞╟╨╤╥╙╘╒╓╫╪▐αßΓπΣσµτΦΘΩδ∞φ |
||
</pre> |
</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}}== |
=={{header|Tcl}}== |