[ic] How to Access the value of [] in a test
Joachim Leidinger
interchange-users@interchange.redhat.com
Tue May 7 18:16:01 2002
Xavier de GELIS wrote:
>
> I checked the [if] documentation but I cannot find a way to properly test
> the subtotal value:
>
> [if value subtotal != 0]
> ..........
> [else]
> ..........
> [/else]
> [/if]
If you want to get the amount of the subtotal, you have to set it into a
variable like
[tmp mysubtotal][subtotal noformat=1][/tmp]
or
[seti mysubtotal][subtotal noformat=1][/seti]
because, [subtotal] is not a variable. It is a function call!
You have to add "norformat=1" to get a real not formatted value of it
(not 12.34 $), because any chars like "abc" oder "$" results to zero in
any calculation of perl.
The next step is to test the value of the subtotal like
[if scratch subtotal != 0]
..........
[else]
..........
[/else]
[/if]
ciao
Joachim
--
Hans-Joachim Leidinger | Dipl.-Phys.Ing. Entwicklung eCommerce
[leidinger@bpanet.de]
Black Point Arts Internet Solutions GmbH
http://www.bpanet.de