Advanced macro feature
The IDE also provides a feature enabling you to determine the suffix in the instantiated object conditionally. The syntax for this feature is
__MacroName$Param1$Param2$Param3__where Param2 replaces Param1 if the value of MacroName ends in Param1. If the value of MacroName does not end in Param1, Param3 is returned as the value for the macro.
For example, if you enter the following into a template:
__Name$Impl$Spec$Unknown__and you create an object from the template called
MyClassImpl
, the textMyClassSpec
would be returned by the macro in the new object. If the object you created was merely calledMyClass
, the valueUnknown
would be returned.Tip: Macros are particular useful when you create groups using the Group of Files template. You can create your own group, integrate macros into the name and text of the files, and then turn that group into a template.
Contents | Prev | Next | Index |