Hi,
my problem is as follows:
WideCompareStr(FName,'')<>0
returns false even with FName set to ''.
WideCompareStr(trim(FName),'')<>0
returns the desired result. Why do I have to trim an empty string ('') for a comparison with another empty sting to get the correct result?
EDIT:
to clear things up: I had the following Code to test wether a widestring-variable is the empty string or not.
function TSybVerwandlung.isEmpty: Boolean;
var
I : Integer;
begin
Result:=true;
if WideCompareStr(FName,'')<>0 then Result:=false
else if WideCompareStr(FInfo,'')<>0 then Result:=false
else
begin
//additional tests
end;
end;
This function returned true even with FName set to '' (I checked it in the debugger). After inserting trim(FName) and trim(FInfo) instead of the variables, it returned the desired result.
Did I miss something essential? The compiler I use is Borland Delphi 2006