Case-sensitivity of identifiers: Difference between revisions

Content added Content deleted
(Added Dart)
(Added Chipmunk Basic, GW-BASIC, Minimal BASIC, MSX Basic Quite BASIC and XBasic)
Line 187: Line 187:


The three dogs are named Benjamin, Samba and Bernie.
The three dogs are named Benjamin, Samba and Bernie.



=={{header|BASIC}}==
=={{header|BASIC}}==
Line 194: Line 193:
<syntaxhighlight lang="basic">dog$ = "Benjamin":Dog$ = "Samba":DOG$ = "Bernie":III = 254 * (DOG$ = dog$ AND Dog$ = DOG$) + 1: PRINT MID$ ("There is just one dog",256 - III) MID$ ("The three dogs are",III)" named " MID$ (dog$ + ", " + Dog$ + " and ",III)DOG$"."</syntaxhighlight>
<syntaxhighlight lang="basic">dog$ = "Benjamin":Dog$ = "Samba":DOG$ = "Bernie":III = 254 * (DOG$ = dog$ AND Dog$ = DOG$) + 1: PRINT MID$ ("There is just one dog",256 - III) MID$ ("The three dogs are",III)" named " MID$ (dog$ + ", " + Dog$ + " and ",III)DOG$"."</syntaxhighlight>
{{out}}
{{out}}
<pre>There is just one dog named Bernie.
<pre>There is just one dog named Bernie.</pre>
</pre>
The Apple II and Apple II plus will convert all input characters to upper case.
The Apple II and Apple II plus will convert all input characters to upper case.
<pre>THERE IS JUST ONE DOG NAMED BERNIE.
<pre>THERE IS JUST ONE DOG NAMED BERNIE.</pre>
</pre>


==={{header|BASIC256}}===
==={{header|BASIC256}}===
Line 207: Line 204:
print "There is just one dog, named "; dog
print "There is just one dog, named "; dog
end</syntaxhighlight>
end</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Bernie</pre>


==={{header|BBC BASIC}}===
==={{header|BBC BASIC}}===
Line 213: Line 212:
DOG$ = "Bernie"
DOG$ = "Bernie"
PRINT "The three dogs are " dog$ ", " Dog$ " and " DOG$ "."</syntaxhighlight>
PRINT "The three dogs are " dog$ ", " Dog$ " and " DOG$ "."</syntaxhighlight>
{{out}}
Output:
<pre>The three dogs are Benjamin, Samba and Bernie.</pre>
<pre>The three dogs are Benjamin, Samba and Bernie.</pre>

==={{header|Chipmunk Basic}}===
Chipmunk Basic is case-insensitive
<syntaxhighlight lang="qbasic">10 dog$ = "Benjamin"
20 dog$ = "Smokey"
30 dog$ = "Samba"
40 dog$ = "Bernie"
50 print "There is just one dog, named ";dog$</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Bernie</pre>


==={{header|FreeBASIC}}===
==={{header|FreeBASIC}}===
Line 226: Line 235:
Print "There is just one dog, named "; dog
Print "There is just one dog, named "; dog
Sleep</syntaxhighlight>
Sleep</syntaxhighlight>

{{out}}
{{out}}
<pre>There is just one dog, named Bernie</pre>
<pre>
There is just one dog, named Bernie
</pre>


==={{header|FutureBasic}}===
==={{header|FutureBasic}}===
FB is lettercase-insensitive and throws an error with variables or constants with identical names but of varying case. However, here's an easy work around.
FB is lettercase-insensitive and throws an error with variables or constants with identical names but of varying case. However, here's an easy work around.
<syntaxhighlight lang="futurebasic">
<syntaxhighlight lang="futurebasic">CFDictionaryRef canines
CFDictionaryRef canines
canines = @{@"dog":@"Benjamin", @"Dog":@"Samba", @"DOG":@"Bernie"}
canines = @{@"dog":@"Benjamin", @"Dog":@"Samba", @"DOG":@"Bernie"}
print "The three dogs are "; canines[@"dog"]; ", "; canines[@"Dog"]; " and "; canines[@"DOG"]; "."
print "The three dogs are "; canines[@"dog"]; ", "; canines[@"Dog"]; " and "; canines[@"DOG"]; "."


HandleEvents
HandleEvents</syntaxhighlight>
{{out}}
</syntaxhighlight>
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre>
{{output}}

<pre>
==={{header|GW-BASIC}}===
There are three dogs named Benjamin, Samba and Bernie.
{{works with|PC-BASIC|any}}
</pre>
GW-BASIC is case-insensitive. GW-BASIC keyword tokens and variable names get converted to upper case in programs.
<syntaxhighlight lang="qbasic">10 dog$ = "Benjamin"
20 dog$ = "Smokey"
30 dog$ = "Samba"
40 dog$ = "Bernie"
50 print "There is just one dog, named ";dog$</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Bernie</pre>


==={{header|Liberty BASIC}}===
==={{header|Liberty BASIC}}===
{{works with|Just BASIC}}
Just BASIC and Liberty BASIC names are case sensitive

NB the IDE warns you that there are similar variables named dog$, Dog$ & DOG$
NB the IDE warns you that there are similar variables named dog$, Dog$ & DOG$
<syntaxhighlight lang="lb">
<syntaxhighlight lang="lb">
Line 254: Line 270:
print "The three dogs are "; dog$; ", "; Dog$; " and "; DOG$; "."
print "The three dogs are "; dog$; ", "; Dog$; " and "; DOG$; "."


end</syntaxhighlight>
end
{{out}}
</syntaxhighlight>
The three dogs are Benjamin, Samba and Bernie.
<pre>The three dogs are Benjamin, Samba and Bernie.</pre>

==={{header|Minimal BASIC}}===
Minimal BASIC is case-insensitive. Minimal BASIC convert all input characters to upper case.
<syntaxhighlight lang="qbasic">10 let d$ = "Benjamin"
20 let D$ = "Samba"
30 print "There is just one dog, named "; d$
40 end</syntaxhighlight>
{{out}}
<pre>THERE IS JUST ONE DOG, NAMED SAMBA</pre>

==={{header|MSX Basic}}===
{{works with|MSX BASIC|any}}
MSX BASIC is case-insensitive. MSX-BASIC keyword tokens and variable names get converted to upper case in programs.
<syntaxhighlight lang="qbasic">10 dog$ = "Benjamin"
20 dog$ = "Smokey"
30 dog$ = "Samba"
40 dog$ = "Bernie"
50 print "There is just one dog, named ";dog$</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Bernie</pre>


==={{header|PureBasic}}===
==={{header|PureBasic}}===
Line 270: Line 306:
DOG$ = "Bernie"
DOG$ = "Bernie"
PRINT "There is just one dog, named "; DOG$</syntaxhighlight>
PRINT "There is just one dog, named "; DOG$</syntaxhighlight>

==={{header|Quite BASIC}}===
Quite BASIC is case-insensitive
<syntaxhighlight lang="qbasic">10 let d$ = "Benjamin"
20 let D$ = "Samba"
30 print "There is just one dog, named "; d$
40 end</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Samba</pre>


==={{header|Run BASIC}}===
==={{header|Run BASIC}}===
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
Run BASIC names are case sensitive
<syntaxhighlight lang="runbasic">
<syntaxhighlight lang="runbasic">
dog$ = "Benjamin"
dog$ = "Benjamin"
Line 277: Line 325:
Dog$ = "Samba"
Dog$ = "Samba"
DOG$ = "Bernie"
DOG$ = "Bernie"
print "The 4 dogs are "; dog$; ", "; doG$; ", "; Dog$; " and "; DOG$; "."
print "The 4 dogs are "; dog$; ", "; doG$; ", "; Dog$; " and "; DOG$; "."</syntaxhighlight>
{{out}}
</syntaxhighlight>
<pre>The 4 dogs are Benjamin, Smokey, Samba and Bernie.</pre>


==={{header|True BASIC}}===
==={{header|True BASIC}}===
Line 288: Line 337:
PRINT "There is just one dog, named "; dog$
PRINT "There is just one dog, named "; dog$
END</syntaxhighlight>
END</syntaxhighlight>

==={{header|XBasic}}===
XBasic in case-insensitive
<syntaxhighlight lang="qbasic">PROGRAM "Case-sensitivity"
VERSION "0.0000"

DECLARE FUNCTION Entry ()

FUNCTION Entry ()
dog$ = "Benjamin"
dog$ = "Smokey"
dog$ = "Samba"
dog$ = "Bernie"
PRINT "There is just one dog, named "; dog$
END FUNCTION
END PROGRAM</syntaxhighlight>
{{out}}
<pre>There is just one dog, named Bernie</pre>


==={{header|Yabasic}}===
==={{header|Yabasic}}===
Line 293: Line 361:
<syntaxhighlight lang="yabasic">
<syntaxhighlight lang="yabasic">
dog$ = "Benjamin"
dog$ = "Benjamin"
doG$ = "Smokey"
Dog$ = "Samba"
Dog$ = "Samba"
DOG$ = "Bernie"
DOG$ = "Bernie"
print "The three dogs are named ", dog$, ", ", Dog$, " and ", DOG$
print "The four dogs are named ", dog$, ", ", doG$, ", ", Dog$, " and ", DOG$
end</syntaxhighlight>
end</syntaxhighlight>
{{out}}
<pre>The four dogs are named Benjamin, Smokey, Samba and Bernie</pre>


==={{header|ZX Spectrum Basic}}===
==={{header|ZX Spectrum Basic}}===
<syntaxhighlight lang="basic">10 LET D$="Benjamin"
<syntaxhighlight lang="basic">10 LET D$="Benjamin"
20 PRINT "There is just one dog named ";d$</syntaxhighlight>
20 PRINT "There is just one dog named ";d$</syntaxhighlight>




=={{header|Batch File}}==
=={{header|Batch File}}==