Where I work, we are still using Delphi 2009. I happened to look at the Forms block in VCL and came across:
[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)] function DisableTaskWindows(ActiveWindow: HWnd): TTaskWindowList;
This attribute is clearly a CLR class of UIPermissionAttribute , but unlike other CLR references, this attribute is not wrapped in conditional compilation directives .
This surprised me because AFAIK in versions of Delphi Win32 until 2010, brackets were used only to indicate indexes in arrays and collection types, defining sets and assigning GUIDs to interfaces. This is not true.
I did a regex search and found dozens of examples throughout RTL / VCL. Some of them were type attributes, and some were methods.
Is this simply ignored by the compiler, or do they serve some purpose in Win32?
I also found a syntax that looked like this:
[!UnitName] [!InterfaceName]
This seems to be related to generating the source files from the template in the IDE wizard, but they were not in the RTL source folder. They were in the repository folder of the object.
source share