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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Insensitive

Status
Not open for further replies.

beginner81

Programmer
Oct 27, 2003
44
MY
How do i ignore the case sensitive while i'm doing the verification for certain field ??
for example .. IF (custNo = EditCustNo.Text) then .....
In this case, i want the system to accept both upper and lower case of EditCustNo.Text .. what should i do then ??
 
IF ( CompareText(custNo, EditCustNo.Text) = 0 ) then...
 
..I didn't know about the CompareText function, thanks for that ppc386, I've always done it like this

if UpperCase(Custno) = Uppercase(editCustNo.text) then...

lou

 
Or you can use the SameText function in Delphi 6 and higher:

---------------------------------------

Compares two strings by ordinal value without case sensitivity.

Unit

SysUtils

Category

string handling routines

function SameText(const S1, S2: string): Boolean;

Description

SameText compares S1 and S2 and returns true if they are equal. SameText is not case sensitive and is not affected by the current locale.

-----------------------------------------------

l8r...
 
in delphi5 you can use the AnsiString compare functions (they also use the current locale for comparison). give it a try. though for what you need AnnaDapter's post will do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top