cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Topic Markup Language and applications: Answered

Variable Handling


Hallo,

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.

Thorsten
Heya,

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

eg

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

-- SvenDowideit - 09 Jan 2009
Hallo,

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
Extension
Version TWikiRelease04x02x03
Status Answered
Topic revision: r5 - 07 Feb 2009, ArthurClemens - This page was cached on 19 Aug 2018 - 23:27.

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