+3

[W521] Now shown when using unitialized Result in right side of assignment

Anonymous 10 years ago 0
This code does not trigger the warning:

{code}
function DoSomething(const s: string): string;
begin
if StartsStr('\', s) then
Result := Copy(Result, 1);
end;
{code}

Yes, the code snippet does not make any sense and the real code is a bit more complex but the fact that the right side of the assignment contains Result is causing the warning to not be shown.