Delphi 2009 Win32.
The code below tries to add a 257 length string to a memo. It compiles and runs fine, but nothing is added to the memo.
Memo1.Lines.Add('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
Looks like a compiler bug. Is it? Because if the string was 256 long, I'd get a compiler error and couldn't compile the app.
Any way to make the app break when the developer tries to do something like this?
I know I could split the string and make this code work, but my point is to prevent developers for using this invalid code without noticing.
Thanks