[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
RE: [mv] Comparing numeric value using IF
****** message to minivend-users from "Christopher Thompson" <ct@arborinternet.com> ******
The first question is what is My_field: scratch, value, database field?
The second is if the comparison is inside a loop/list or not?
> -----Original Message-----
> From: owner-minivend-users@minivend.com
> [mailto:owner-minivend-users@minivend.com]On Behalf Of Curt Hauge
> Sent: Sunday, July 02, 2000 4:48 PM
> To: Minivend-Users@Minivend. Com
> Subject: [mv] Comparing numeric value using IF
>
>
> ****** message to minivend-users from "Curt Hauge"
> <chc@mninter.net> ******
>
> Hi List,
>
> On MV 4.04, Linux Mandrake 6.0, I have been trying to do what
> seems to be a
> simple comparison of numeric values. I have researched the docs
> and several
> perl sites, but still can't get the desired result. Basically, I wish to
> check the value of My_field to see if it is equal to 1 (It is
> either 1 or
> 0). Here is a sample of what I have tried:
>
> [if type="value" term="My_field" op="==" compare="1"]
> Hello
> [/if]
> (tried op="eq", op="=~", term="[item-data My_file My_field]",
> compare="/1/",
> compare="^1", compare="/^1/", and several variations of these)
>
> also:
>
> [if value My_field == /^1/]
> Hello
> [/if]
>
> which always produces Hello, whether value is a 1 or 0
>
> (tried =~, [My_field], [item-data My_file My_field], == 1, == ^1, and
> variants)
>
> and:
> [if explicit]
> [condition]
> $My_value = '[value My_field]';
> return 1 if $My_value =~ /1/;
> return 0;
> [/condition]
> Hello
> [/if]
>
> (tried [value [item-data My-file My_field]], [value [My_field]], ==, and
> variants)
>
> A sampling of error log, in no particular order:
>
> Bad if 'value My_field == ^1': syntax error at (eval 323) line
> 1, near "==
> ^"
> Bad if 'value My_field =~ ^1': syntax error at (eval 354) line
> 1, near "=~
> ^"
> Bad if 'value 0 = 1': Can't modify constant item in scalar assignment at
> (eval 357) line 2, at EOF
> Bad if 'value My_field = 1': Can't modify constant item in
> scalar assignment
> at (eval 349) line 2, at EOF
> Bad if 'value 0 g [My_field]': syntax error at (eval 303) line
> 1, near "q{}
> g "
> Bad if 'value My_field = 1': Can't modify constant item in
> scalar assignment
> at (eval 351) line 2, at EOF
>
> It has been several hours of trial and error and, while I do have a
> workaround (which is not based on a conditional expression), I
> really wish
> to do it this way. All help is greatly appreciated.
>
> Thanks in advance,
>
> Curt
>
>
> -
> 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