[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] if tag weird behavior


Quoting Ton Verhagen (suppressed):
> Quoting Mike Heins <suppressed> :
> >Explicit is intended to have valid code as it's test, and a literal like
> >that has undetermined behavior when interpreted as Perl code.
> >
> >Why you would do that instead of:
> >
> >        [if scratch test_value]
> >        foo
> >        [/if]
> 
> Because I simplified the code a bit.
> 
> I am actually testing if a control of a component contains a value or not.
> And as far as I am aware of, there is no [if control test_value] 
> available in IC.
> 
> I had something like below in a modified random component:
> 
> [loop serach=|
>         fi=products
>         st=db
> [if type=explicit condition="[control brand]"]
>         sf=brand
>         se=[control brand]
>         op=eq
> [else]
>         ra=yes
> [/else]
> [/if]
> |]
>         do something
> [/loop]
> 
> Everything seemed to work well until we discovered that for
> brand=00000159 no proper results were returned.

You just can't do it. You need to give valid code, not an unquoted
literal. You can do:

[if type=explicit condition="'[control brand]'"]
        sf=brand
        se=[control brand]
        op=eq
[else]
        ra=yes
[/else]
[/if]


-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <suppressed>

Few blame themselves until they have exhausted all other possibilities.
 -- anonymous
_______________________________________________
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.