Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From the book teach yourself V B 6 in 24 Hours

Status
Not open for further replies.

bigbyter

IS-IT--Management
Feb 9, 2006
7
GB
This is probably obvious but

If this " 4 > 2 = True " is correct
and " 4 < 1 = False " is correct.

Then how can this be correct "Macmillan" < "Mc millan" = True

Thanks



 
For Alpha-strings "Less Than" (<) means "occurs before in alphabetic order." As GhostWolf implies, "a" occurs before "c" ... therefore it is less than "c".
 
Ok I get it "I think" I was calculating the total value of both words from the ascii values and of course it still didnt work.
So just to clarify a bit more if the first two characters of the words were identical it would depend on the alphabetic order of the third character, I guess that may be an unlikely occurrance but is that the way it would work?.
Thanks to both of you I really appreciate the help
 
Yep, I think that's the way it works. Not all that unlikely, though - dictionaries and phone books are good examples.
 
ASCII values are themselves in alphabetical order..

Asc("a") < Asc("c"

Just remember that it goes char by char rather than takeing the value of the entire string.
 
and that it's case sensitive........

Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top