Reported by Keith Procter; checked by Jordan Russell
Note that once you get a DBG2499 error, it will occur in all subsequent compiles, until Delphi is restarted. The error occurs when you have a resource string after the first sub procedure, regardless if it is in another sub-procedure, or just within the body of the procedure (but you have to have a second sub-procedure). It can be boiled down to a program that doesn't use objects, so it looks like it's a sub-procedure bug. The solution is to move your ResourceString declarations to before the first sub-procedure. Following program will generate the error, restart Delphi and move the resource string to just under "procedure Foo;" to make it go away
program _;
procedure Foo;
procedure n;
begin
end;
resourcestring
d='';
procedure C;
begin
end;
begin
C;
n;
end;
begin
Foo;
end. |