This question about Topic Markup Language and applications: Answered

Variable Handling


how can i access to a VAR in the view script when it was set in a topic?

I have set it in the topic text like this:
* #set VARNAME = on

I have tried it with TWiki::Prefs::getPreferencesValue( "VARNAME" ) and TWiki::Func::getPreferencesValue( "VARNAME" ) but i m getting an error: "Undefined Subroutine ...".

Can someone explain me please what i have to do, to access to a self created VAR?

Thx alot.


to set a variable, you need to remove the # character, and possibly to make it a capital S


  • Set VARNAME = on
we traditionally use the # to comment out a setting

-- SvenDowideit - 09 Jan 2009

of course i have set the VAR without a #. This was only written down here by me to not set a VAR here. I m getting an error "Undefined Subroutine ..." while trying to access the VAR by TWiki::Func::getPreferencesValue. I wrote at the top of the script "use Twiki;". Am I right? Or should I write smth else? Have I forgortten smth.?

I created a VAR in a Topic and want to access to it in a script. So I need a short explanation or an example how I have to do it.

Thx alot. -- ThorstenMueller09 - 12 Jan 2009

QuestionForm edit

Subject Topic Markup Language and applications
Version TWikiRelease04x02x03
Status Answered
Topic revision: r5 - 07 Feb 2009, ArthurClemens - This page was cached on 17 Mar 2019 - 22:43.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy