delphi assign to const? -
this site : http://www.drbob42.com/delphi/wizards.htm
showed puzzling code @ bottom
unit sharemem; { (c) 1997 bob swart (aka dr.bob - http://www.drbob42.com } interface const ... uses windows; const handle: thandle = 0; ... function getcommandline: pchar; stdcall; external 'kernel32.dll' name 'getcommandlinea'; ... begin handle := loadlibrary('bcbmm.dll'); end.
how ?
a typed const
, default (edit: noted rob in comments, changed no longer default years ago), more static variable. you can turn behavior off compiler directive.
this commonly used substitute class/static properties in old versions of delphi. delphi has feature, there no reason imho.
Comments
Post a Comment