[pmwiki-users] Set PTV to value of an expression

Lars Eighner surname at larseighner.com
Sun Jul 28 05:44:02 CDT 2013

On Sat, 27 Jul 2013, Peter Bowers wrote:

> On Fri, Jul 26, 2013 at 12:31 AM, Lars Eighner <surname at larseighner.com>wrote:
>> I want to set a PTV to the value of an expression which is evaluated once
>> when the PTV is set and is never evaluated again so that the PTV has the
>> value of the result string, not the expression string.
> Unfortunately this is not possible with the current implementation of
> PTVs.[1]
> You are exactly correct that the PTV becomes the *expression* rather than
> the *value* of the expression.

Good. I thought I was losing what little was left of my mind when I could
not get PTVs to behave according my intuitive concept of variables. In any
event, knowing I am on the wrong track is progress of a sort.

This is the thinking outloud part (not a request except for hints):

What I probably want is a new kind of variable that could be set from a DB
when a page is loaded and the DB updated on save.  I really do not want to
do forms.

> PTV assignment is simple text parsing, assigning the straightforward text
> (which in this case is the expression).  All pmwiki "evaluation" of
> expressions is done by means of rules, but the rules run on the text of the
> current page, not on the value held in the PTV unless the value of the PTV
> becomes part of the text of the current page (if that makes sense).
> -Peter
> [1] Perhaps a certain subset of rules could be identified and then
> variables could have their text run through those rules at the moment of
> reading them.  But it'd be pretty inefficient, I'm afraid...

Lars Eighner
8800 N IH35 APT 1191 AUSTIN TX 78753-5266

More information about the pmwiki-users mailing list