Interesting bug in IDE (2009+) Get link Facebook X Pinterest Email Other Apps - October 28, 2014 Interesting bug in IDE (2009+)Type length)( in editor Get link Facebook X Pinterest Email Other Apps Comments Jeroen Wiert PluimersOctober 29, 2014 at 11:14 AMJacek Laskowski indeed. That has been the Delphi build path since about 20 years.ReplyDeleteRepliesReplyMahdi SafsafiOctober 29, 2014 at 11:30 AMNo ,it's not a bug , because length is used as a macro for constant , and as a pure function for variable.The same applies for "sizeof",except its a pure macro.eg:var Str: string; L, sz: Integer;begin Str := '123'; L := Length(Str); L := Length('123'); Length('123'); // Error. sz := sizeof(Str); sizeof(Str); // Error.end;ReplyDeleteRepliesReplyJeroen Wiert PluimersOctober 30, 2014 at 2:34 AMThis works fine too, so the context must be more confined:unit Unit1;interfaceimplementationprocedure Foo();begin length)(end;end.ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
Jacek Laskowski indeed. That has been the Delphi build path since about 20 years.
ReplyDeleteNo ,it's not a bug , because length is used as a macro for constant , and as a pure function for variable.
ReplyDeleteThe same applies for "sizeof",except its a pure macro.
eg:
var
Str: string;
L, sz: Integer;
begin
Str := '123';
L := Length(Str);
L := Length('123');
Length('123'); // Error.
sz := sizeof(Str);
sizeof(Str); // Error.
end;
This works fine too, so the context must be more confined:
ReplyDeleteunit Unit1;
interface
implementation
procedure Foo();
begin
length)(
end;
end.