Compare Case Sensitive OR Case Insensitive Mixed String?
Posted: Tue May 16, 2006 7:35 pm
I'm using GetRVDataText to get the text from two variables of type TRVTableCellData. Depending on option settings I want to compare them in either case sensitive or case insensitive fashion, and be able to support unicode characters in the text.
This code works for non-Unicode strings :
if CaseSensitive then
begin //Do case-sensitive compare
if CompareStr(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end
else
begin //Do case-insensitive compare
if CompareText(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end;
What is the proper approach to be able to handle the text returned from GetRVDataText which can/will include Unicode characters (the control is set to rvuMixed.
This code works for non-Unicode strings :
if CaseSensitive then
begin //Do case-sensitive compare
if CompareStr(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end
else
begin //Do case-insensitive compare
if CompareText(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end;
What is the proper approach to be able to handle the text returned from GetRVDataText which can/will include Unicode characters (the control is set to rvuMixed.