[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] more 'if' help help help elp....
****** message to minivend-users from Ed LaFrance <edl@newmediaems.com> ******
I sounds like you want a CASE-style structure. There isn't one in the
minivend tag set, that I know of (hmmm...). You could do series of
separate ifs:
[if value something == 1]
something 1
[/if]
[if value something == 2]
something 2
[/if]
.
.
etc.
You could also do it in one structure, using [calc] or [perl] tags (this is
demo code, may not work):
[perl arg="values"]
$a = $Safe{values}->{something};
if $a == 1 {$b = 2};
if $a == 2 {$b = 5};
# etc.
return $b;
[/perl]
, depending on what you wish to output, but there may not be any
advantages over using straight minivend tags.
- Ed L.
At 02:41 PM 6/1/00 +0100, you wrote:
>Can any help me with the syntax for a different type of if
>
>currently I know of being able to
>
>i.e.
>
>[if value somthing == 1]
> [then] something 1 [/then]
> [elseif value something == 2] something 2 [/elsif]
> [else] something rest [/else]
>[/if]
>
>
>but I would really like to be
>
>[if value something]
> [condition something == 1] something 1 [/condition]
> [condition something == 2] something 2 [/condition]
> [condition something == 3] something 3 [/condition]
> [condition something == 4] something 4 [/condition]
>........and so on.......
>[/if]
>
>
>so it finds the contion that matches and does it.
>bit like a case statement.
>
>I know that I can use no end of nested Ifs but that becomes messy
>
>any help???????????
>
>--
>'Darn it, who spiked my coffee with water?!' - larry wall
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| New Media E.M.S. Software Solutions for Business |
| 12831 Blanco Ct. Consulting |
| Poway, CA 92064 U.S.A. Custom Programming |
| 858-486-6508 Internet and eCommerce |
| 630-604-4265 eFax |
| edl@newmediaems.com |
| http://www.newmediaems.com |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
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