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

Content added Content deleted
(Added Wren)
(Added XPL0 example.)
Line 667:
<pre>
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_
</pre>
 
=={{header|XPL0}}==
Paraphrasing code from the compiler's parser:
<lang XPL0>char C, C1;
[Text(0, "First character set: ");
for C:= 0 to 255 do
if C>=^A then if C<=^Z ! C=^_ then
ChOut(0, C);
CrLf(0);
Text(0, "Next characters set: ");
for C:= 0 to 255 do
[if C>=^a & C<=^z then C1:= C & $DF \to uppercase
else C1:= C;
case of
C1>=^A & C1<=^Z, C1>=^0 & C1<=^9, C1=^_ :
ChOut(0, C)
other [];
];
CrLf(0);
]</lang>
 
{{out}}
<pre>
First character set: ABCDEFGHIJKLMNOPQRSTUVWXYZ_
Next characters set: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz
</pre>