[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 Ramsey French <rammjet@mac.com> ******
Another option is to put all of the "something's" in a lookup table keyed on
1, 2, 3, 4, etc. Then just pull the correct "something" based on the value.
Think of it as sort of an array.
Array Element
Element Value
1 Something 1
2 Something 2
3 Something 3
..etc...
If this is a decision process used numerous times, put the table in memory.
> ****** message to minivend-users from "Christopher Thompson"
> <ct@arborinternet.com> ******
>
> You might really want an alternate syntax, but it is't part of MML (nor
> Perl). And since the [elsif] does the same thing as what you want, us it.
> Just close your eyes when you have to scroll past that section of code.
>
>
> -----Original Message-----
> From: owner-minivend-users@minivend.com
> [mailto:owner-minivend-users@minivend.com]On Behalf Of Adam Kett
> Sent: Thursday, June 01, 2000 6:41 AM
> To: minivend-users@minivend.com
> Subject: [mv] more 'if' help help help elp....
>
>
> 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
>
>
>
> -
> 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
-
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