Jon Jensen wrote:
For purpose of clarity: the [if] tag needs some kind of "type" passed to it so it knows the space from which to draw the values it will be testing. For example:On Mon, 25 Oct 2004, Boyer, Jim wrote:I know this should be simple but I sure can't figure it out. I am setting a variable in my catalog.cfg as such: Variable WINHOST True I am not having success reading this variable in the receipt.html page. I can print out the value of the variable, but I want to make a decision on the value of the variable. I have tried the following but without success. I have not found examples of this in the docs, but I could have easily missed them. [if __WINHOST__ ] [if __WINHOST__ eq True] [if @_WINHOST_@ eq True] [if [var WINHOST] eq True] What am I doing wrong with this simple test?Try: [if variable WINHOST] Jon
[if cgi testme eq Me]The "type" parameter is the first parameter by default (when you are using unnamed parameters). Thus, the "type" of the above [if...] is "cgi". Interchange will look at the value of CGI variable "testme" and result in TRUE if that variable is equal to the literal "Me".
When you want to get into fancier tests relying on the interpolation of other values, you will either need to use a type=explicit if, as shown in Ed LaFrance's response to your post, or you'll need to expliciitly name all the arguments and wrap whatever requires interpolation in some kind of quote (single quote, double-quote, or pipes). For instance:
[if type=scratch term=junk op=eq compare=|[cgi testme]|]This will result in TRUE if the scratch variable "junk" ("type=scratch" and "term=junk") is equal ("op=eq") to the value held within the cgi variable "testme" ("compare=|[cgi testme]|").
Finally, my understanding is that the variable tokens (@@SOMETHING@@, __SOMETHING__) are interpolated in an earlier pass than the usual ITL tags. This can complicate things sometimes.
Hope this helps. -- Ethan Rowe End Point Corporation suppressed _______________________________________________ interchange-users mailing list suppressed http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.