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

Peter Bowers pbowers at pobox.com
Sat Jul 27 22:02:43 CDT 2013


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.

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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20130727/0db04b55/attachment.html>


More information about the pmwiki-users mailing list