Looking for help in writing a code that will compare two names and determine if they are equal,less than,or greater than the other.Alphabetically speaking.
Printable View
Looking for help in writing a code that will compare two names and determine if they are equal,less than,or greater than the other.Alphabetically speaking.
u can compare the 2 strings as
If String1 = String2 then
' ......
End if
I can't understand, what do u mean by "Alphabetically speaking"
If u mean the length of the string then u can get that by
Len(String1) function
If u give an example for the cases where Less Than & Greater Than Occur I may be able to help u.
Srinika
I think he wants to make a lexicographical comparison of the two strings.
It can be done like this ..
If String1 > String2 Then
If String1 < String2 Then
etc.
So, ("apple" < "peach") will return True, while
("banana" < "apple") will return False.
Regards,
The Beret.
First time in my life I heard the word - lexicographical
Srinika
This application will help file records alphabetically.You enter two names in txtName1 and txtName2.I have a command button named cmdCompare.I need corresponding code to determine if the two names are equal to each other.Example John Doe = John Doe or one name is less than the other.Example Al Alda is less than Zack Zeller. or one name is greater than the other.The answer will display true or false in txtName1=Name2,txtName1<Name2 or txtName1>Name2.Using the last name starting with A as the least value. Thanks
The word Lexicon means Dictionary and since in a dictionary all the words appear in their alphabetical order , lexicographical means alphabetical.
P.S : There's always a first time for everything!
Regards,
The Beret.
Webster defines "Lexicographical Work" as a dictionary.
John G