Alternative USING macro for defining type aliases

Share your advanced PureBasic knowledge/code with the community.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Alternative USING macro for defining type aliases

Post by Mistrel »

Instead of this:

Code: Select all

Interface ITriangle2i Extends Triangle2i::IObject
EndInterface

Structure PointArray3 Extends Shape2i::PointArray3
EndStructure
You can write this:

Code: Select all

USING(Interface, ITriangle2i, Triangle2i::IObject)
USING(Structure, PointArray3, Shape2i::PointArray3)
With the following macro:

Code: Select all

Macro USING(keyword, identifier, type)
keyword identifier Extends type
End#keyword
EndMacro