Jump to content

Idiomatically determine all the lowercase and uppercase letters: Difference between revisions

Idiomatically determine all the lowercase and uppercase letters in various dialects BASIC
(add RPL)
(Idiomatically determine all the lowercase and uppercase letters in various dialects BASIC)
Line 165:
uppercase 60: ABCDEFGHIJKLMNOPQRSTUVWXYZSOZYAAAAÄÅÆÇEÉEEIIIIDÑOOOOÖOUUUÜY_
</pre>
 
=={{header|BASIC}}==
==={{header|Applesoft BASIC}}===
{{works with|Chipmunk Basic}}
{{works with|GW-BASIC}}
<syntaxhighlight lang="qbasic">10 FOR j = ASC("a") TO ASC("z")
20 PRINT CHR$(j);
30 NEXT j
40 PRINT
50 FOR j = ASC("A") TO ASC("Z")
60 PRINT CHR$(j);
70 NEXT j
80 END</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|BASIC256}}===
<syntaxhighlight lang="vb">for j = asc("a") to asc("z")
print chr(j);
next j
print
for j= asc("A") to Asc("Z")
print chr(j);
next j
end</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|Chipmunk Basic}}===
{{works with|Chipmunk Basic|3.6.4}}
{{works with|Applesoft BASIC}}
{{works with|GW-BASIC}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">10 FOR j = ASC("a") TO ASC("z")
20 PRINT CHR$(j);
30 NEXT j
40 PRINT
50 FOR j = ASC("A") TO ASC("Z")
60 PRINT CHR$(j);
70 NEXT j
80 END</syntaxhighlight>
 
==={{header|GW-BASIC}}===
{{works with|Applesoft BASIC}}
{{works with|Chipmunk Basic}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">10 FOR j = ASC("a") TO ASC("z")
20 PRINT CHR$(j);
30 NEXT j
40 PRINT
50 FOR j = ASC("A") TO ASC("Z")
60 PRINT CHR$(j);
70 NEXT j
80 END</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|QBasic}}===
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
{{works with|Applesoft BASIC}}
{{works with|Chipmunk Basic}}
{{works with|GW-BASIC}}
<syntaxhighlight lang="qbasic">10 CLS : REM 10 HOME for Applesoft BASIC
20 FOR J = ASC("a") TO ASC("z")
30 PRINT CHR$(J);
40 NEXT J
50 PRINT
60 FOR J = ASC("A") TO ASC("Z")
70 PRINT CHR$(J);
80 NEXT J
90 END</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|Run BASIC}}===
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
{{works with|Yabasic}}
<syntaxhighlight lang="vb">for j = asc("a") to asc("z")
print chr$(j);
next j
print
for j = asc("A") to asc("Z")
print chr$(j);
next j
end</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|True BASIC}}===
<syntaxhighlight lang="qbasic">FOR j = ORD("a"[1:1]) TO ORD("z"[1:1])
PRINT CHR$(j);
NEXT j
PRINT
FOR j = ORD("A"[1:1]) to ORD("Z"[1:1])
PRINT CHR$(j);
NEXT j
END</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
==={{header|Yabasic}}===
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
{{works with|Run BASIC}}
<syntaxhighlight lang="vb">for j = asc("a") to asc("z")
print chr$(j);
next j
print
for j= asc("A") to asc("Z")
print chr$(j);
next j
end</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
=={{header|C}}==
2,131

edits

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