[pmwiki-users] summing variables

posti at taavi.org posti at taavi.org
Wed Apr 23 04:18:21 CDT 2008

> WikiSh has this capability using a syntax like {$:var${counter}} to work
> with "pseudo-arrays".  If you think you would be interested in this I can
> code it up for you and put it out on the WikiShExamples page.
> It would look *something* like this:
> ===(snip)===
> Set i = 1
> Set --pv total = 0
> While test ${i} -le 35
> Do
>    set --pv total += {$:var${counter}}
> Done
> ===(snip)===
> That would be placed in a page somewhere (Mygroup.Totalcode, for instance)
> and then run from your page via {earlymx(wikish source
> Mygroup.Totalcode)}.
> Then you could access the variable as {$total} elsewhere within your page.
> No guarantees on this - I haven't actually run it and so I might have
> typos
> causing syntax problems or something.
> This is a case where WikiSh works just fine entirely in "read-only" mode
> which is the default.
> -Peter

This looks like what I'm looking for. It would be very kind from you to
code it up. I see I should go for studying using wikish recipe. My
commandline knowlegde  is also veryvery bssics as my php knowledge isn't
even that. This recipe looks very useful.


More information about the pmwiki-users mailing list