thanks so much peter
i'll try this out - thanks!!
adam
On 5 Jun 2008, at 2:29 PM, Peter & Melodye Bowers wrote:
The various control flow elements (conditionals, looping, etc.)
within WikiSh are implemented as part of the {(wikish …)} MX rather
than being individual MXes themselves. Thus {(if test …)} is
undefined as far as WikiSh is concerned. It needs to be {(wikish
if test …)}
While developing your solution you will probably find the control
panel to be *very* helpful. It allows you to type this:
if test 3 –gt 4
then
echo YES
else
echo NO
fi
And it will convert it to {(wikish if test 3 -gt 4; then; echo YES;
else; echo NO; fi;)} and show you the results.
If you’d like to explore other options I’m pretty sure you could
fairly easily (?) expand (:if …:) functionality to include a > or <
comparison using the $Conditions array. I’ve never done it, but
looking at the setting for “equals” in pmwiki.php I think you could
expand it like this:
$Conditions['gt'] = 'CompareArgs($condparm) > 0';
$Conditions['ge'] = 'CompareArgs($condparm) >= 0';
$Conditions['lt'] = 'CompareArgs($condparm) < 0';
$Conditions['le'] = 'CompareArgs($condparm) <= 0';
Or something like that… Others who have worked with this
$Condition variable can give a more exact answer…
-Peter
From: [EMAIL PROTECTED] [mailto:pmwiki-users-
[EMAIL PROTECTED] On Behalf Of adam overton
Sent: Monday, June 02, 2008 1:34 PM
To: pmwiki-users
Subject: [pmwiki-users] WikiSh noob - -gt & -lt
hi
i'm trying out WikiSh for the first time
and am wondering why both
{(if test 3 -gt 4; then; echo YES; else; echo NO; fi)}
&
{(set Num1 = 3)}
{(set Num2 = 4)}
{(if test ${Num1} -gt ${Num2}; then; echo "YES"; else; echo "NO"; fi)}
spit out "3" instead of NO?
btw, is WikiSh my only option if i just want to do a > or < operation?
thanks,
adam
. . .
[EMAIL PROTECTED]
661 373 8679
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users