Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Performing [IF] on scratch variable.....



******    message to minivend-users from "Barry Treahy, Jr." <Treahy@mmaz.com>     ******

Dan Busarow wrote:

> ******    message to minivend-users from Dan Busarow <dan@dpcsys.com>     ******
>
> On Sat, 26 Aug 2000, Tal Hart (TelNET) wrote:
> >  I am using a variable set with [set name var1]0[/set]
> > the Var performs well, i use it within a serach as $var1....
> >
> > Now, i wish to perfrom an [IF] on this var1,
> > and cant get it to work....
> > i guess i dont have the right syntax......
> > what should it be.... ????
>
> [if scratch var1] works for me.

I believe your example only confirms that var1 is defined, not that the contents of
var1 happens to meet any type of regexp criteria.

I'm not a perl expert, but something like this might work:

[if explicit]
[condition]
  $tmpvar = $Safe{'scratch'}{'var1'};
  return 0 if $tmpvar eq "0";
  return 2;
[/condition]
var1 is not zero.
[else]
var1 is zero.
[/else]
[/if]

Barry


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: