[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Can Anyone Get [if] to work in this case?
****** message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com> ******
At 01:32 PM 4/20/00 , you wrote:
>****** message to minivend-users from "John C. Beima"
><jbeima@palb.com> ******
>
>G'Day Folks,
>
>I need to be able to do some conditional code, based on the content of a field
>in one of my database.
[snip]
>But the [if data] doesn't seem to work with scratch variables. so if you go:
>
>[if data base="store" field="pg_[scratch page]_hd" key="[scratch outlet]" ==
>1]
>
>or
>
>[if data base="store" field="pg_[scratch page]_hd" key="[scratch outlet]" ==
>1]
>
>Nothing happens.
>
>Now if you go [if data store::pg_1_hd::100ADM == 1]
>
>It works.
>
>However [if data store::pg_[scratch page]_hd::[scratch outlet]] it doesn't.
>
>I have tried surrounding the scratch variables with quotes and inserting the
>interpolation=1, neither works. I have also tried different variations of [if
>explicit] as well, to no luck.
>
>Any ideas?
Try interpolate=1 (if that was the problem) or perhaps (I forget if this is
right) instead of using == 1, try eq "1"
I have the most success with conditionals using this format:
[if explicit]
[condition]
return 1 if $Safe{'scratch'}->{'outlet'} eq "11-20";
return 0;
[/condition]
<P><I>This item does not contain salt. (11-20)
[else]
<P><I>Our soft plastics are salt-impregnated using a patented process.
[/else]
[/if]
Or maybe this technique could help:
[loop search="fi=store.asc/sf=pg_[scratch page]_hd/se=[scratch
outlet]/ml=1/co=yes"]I found [scratch outlet] in pg_[scratch page]_hd[/loop]
Basically, the conditionals in Minivend can be a bit tricky -- the best
results will be found using Perl. :-)
Ryan Hertz tel 800-645-BAIT
Webmaster fax 520-645-2588
Advertising Director http://yamamoto.baits.com
Gary Yamamoto Custom Baits, Inc. http://www.insideline.net
-
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