Users can create variables, but these are simple 1-value things.
TWiki pre-defined variables, however, often act like simple functions, or at least macros, with parameters.
I would love to see TWiki provide support for users to create macros.
Example:
I do a lot of pattern-based includes. Before INCLUDE sections were implemented, this was the only way to get a piece of a page (and is probably still the only way to get a piece of an external page).
So, I have a lot of this sort of code
%INCLUDE{"TOPIC" pattern="^.*<\!-- BEGIN_PATTERN -->(.*?)<\!-- END_PATTERN -->.*"}%
It would be great if I could write something like this to hold all of the repetitive goo
* MACRO FOO = %%INCLUDE{%ARG% pattern="^.*<\!-- %ARG% -->(.*?)<\!-- %ARG% -->.*"}%
and then evaluate this later as
%FOO{ "MyTopic", "BEGIN_PATTERN", "END_PATTERN"}%
Note that the
MacrosPlugin and couple of other plugins provide support for this sort of thing.
While I sympathise with your desire to keep everything in one place, the TWiki community has decided to keep RFEs in the Codev web until they have been agreed. Please raise this in Codev, and while you are doing it bear in mind that
TWiki:Main.MichaelDaum has been asking for exactly the same thing, and may have already created a Codev topic.
Closed for now. Please reopen when it's an agreed feature.
CC