Reputation: 9080
I have the following code in the VB6 project I just inherited.
Case Is > "S"
Case Is > "Q"
Case Is >= "A"
Case Is = "M"
The only one I sort of understand is the Case Is = "M"
What do the ">" (greater than) symbols represent?
Upvotes: 3
Views: 399
Reputation: 30408
Some links from the Visual Basic 6 manual, rather than later versions :)
Select Case
statement Option Compare
statement which controls string comparisons Upvotes: 1
Reputation: 13312
It compares them alphabetically. See the section here on MSDN entitled "Comparing Strings".
From the docs:
When you compare strings, the string expressions are evaluated based on their alphabetical sort order, which depends on the Option Compare setting.
Option Compare Binary bases string comparisons on a sort order derived from the internal binary representations of the characters. The sort order is determined by the code page. The following example shows a typical binary sort order.
A < B < E < Z < a < b < e < z < À < Ê < Ø < à < ê < ø
Option Compare Text bases string comparisons on a case-insensitive, textual sort order determined by your application's locale. When you set Option Compare Text and sort the characters in the preceding example, the following text sort order applies:
(A=a) < (À= à) < (B=b) < (E=e) < (Ê= ê) < (Ø = ø) < (Z=z)
Upvotes: 3
Reputation: 11914
Strings can be compared with greater than or less than just like numbers can. It should compare their ascii values, basically.
http://www.vbexplorer.com/VBExplorer/Focus/strings_tutorial_2.asp
http://msdn.microsoft.com/en-us/library/215yacb6(v=vs.80).aspx
Upvotes: 3