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 - 2006-10-27 - NielsKoldso
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.