Tags:
create new tag
, view all tags
This page explains by example the TWiki feature proposal TWiki:Codev.DocumentedDefaultParameterValuesForInclude... it should eventually be moved to IncludeTopicsAndWebPages

Disclaimer:


4. Use as a macro

We have created the macro topic SampleMacroDemonstratingIncludeParams and will use it as a macro below.

First try to view the topic raw to find out what it does. Especially note how we use the %debug% variable to display/hide parameter-table output

We try to invocate the macro twice.

4.a Macro invocation A

We write
%INCLUDE{"SampleMacroDemonstratingIncludeParams"}%

And get...

Macro help:

Usage:

  • Order a brunch by writiting %INCLUDE{"Codev.SampleMacroDemonstratingIncludeParams" ...}%
  • Fill in parameters as you please, c.f.table below

%INCLUDEPARAMS{ debug = "no ::doc:: Legal values: yes or no / Show \"Macro Help\" in =%INCLUDINGTOPIC%=" size = "medium ::doc:: Legal values: small , medium or large / Size of brunch" egg = "boiled ::doc:: Legal values: boiled, srambled or porched / How do you want your egg?" }%

Order:

  • A %size% brunch with %egg% eggs.

4.b Macro invocation B

We write
%INCLUDE{"SampleMacroDemonstratingIncludeParams" debug="yes" size="big" egg="porched" }%

And get...

Macro help:

Usage:

  • Order a brunch by writiting %INCLUDE{"Codev.SampleMacroDemonstratingIncludeParams" ...}%
  • Fill in parameters as you please, c.f.table below

%INCLUDEPARAMS{ debug = "no ::doc:: Legal values: yes or no / Show \"Macro Help\" in =%INCLUDINGTOPIC%=" size = "medium ::doc:: Legal values: small , medium or large / Size of brunch" egg = "boiled ::doc:: Legal values: boiled, srambled or porched / How do you want your egg?" }%

Order:

  • A big brunch with porched eggs.

Topic revision: r1 - 27 Oct 2006 - 16:22:31 - NielsKoldso
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback