Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Simple if, why doesn't this work?

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


mark at overmeer

Jul 17, 2013, 1:02 PM

Post #1 of 5 (52 views)
Permalink
Simple if, why doesn't this work?

Dear list,

I have spend a few hours in attempt to understand why this is not
working, and I have not clue. Could be very obvious to an gifted
IC developer.

A form has a radiobutton list. I try to fork between the four options,
with the following code (including debug info)

PAYNOW=[cgi paynow]<br>
PAYMETH=#[cgi paymethod]#<br>

[if cgi paynow]
PAYNOW1=[cgi paynow]<br>
PAYMETH2=#[cgi paymethod]#<br>
[value name="mv_order_route" value="log" hide=1]

%0 [cgi paymethod] %
[if cgi paymethod eq sofort]
[value name="mv_order_profile" value="sisow" hide=1]
SOFORT = [cgi paymethod]<br>
[/if]

%1 [cgi paymethod]%
[if cgi paymethod eq ideal ]
[value name="mv_order_profile" value="sisow" hide=1]
IDEAL = [cgi paymethod], [cgi ideal_bank]<br>
[/if]

%2 [cgi paymethod]%
[if cgi paymethod eq paypal ]
PAYPAL
[value name="mv_order_profile" value="paypal" hide=1]
[value name="pp_use_billing_address" value="0" hide=1]
[xbounce paypalsetrequest]
[/if]

%3 [cgi paymethod]%
[if cgi paymethod eq vorkasse ]
VORKASSE = [cgi paymethod]<br>
[/if]
[/if]

Now, only paymethod="sofort" works. It does not matter whether that
if-block is at the top of the four, or anywhere else. All other
three options do never show their text! I have tried quotes around
the keywords, eq -> = The do show the right value in the debug lines
%0/%1/%2/%3

Anyone?
--
Thanks in advance,

MarkOv

------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark [at] Overmeer solutions [at] overmeer
http://Mark.Overmeer.net http://solutions.overmeer.net


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


gert at 3edge

Jul 17, 2013, 2:09 PM

Post #2 of 5 (49 views)
Permalink
Re: Simple if, why doesn't this work? [In reply to]

> -----Original Message-----
> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-users-
> bounces [at] icdevgroup] On Behalf Of Mark Overmeer
> Sent: woensdag 17 juli 2013 23:02
> To: interchange-users [at] icdevgroup
> Subject: [ic] Simple if, why doesn't this work?
>
>
> Dear list,
>
> I have spend a few hours in attempt to understand why this is not
> working, and I have not clue. Could be very obvious to an gifted
> IC developer.
>
> A form has a radiobutton list. I try to fork between the four options,
> with the following code (including debug info)
>
> PAYNOW=[cgi paynow]<br>
> PAYMETH=#[cgi paymethod]#<br>
>
> [if cgi paynow]
> PAYNOW1=[cgi paynow]<br>
> PAYMETH2=#[cgi paymethod]#<br>
> [value name="mv_order_route" value="log" hide=1]
>
> %0 [cgi paymethod] %
> [if cgi paymethod eq sofort]
> [value name="mv_order_profile" value="sisow" hide=1]
> SOFORT = [cgi paymethod]<br>
> [/if]
>
> %1 [cgi paymethod]%
> [if cgi paymethod eq ideal ]
> [value name="mv_order_profile" value="sisow" hide=1]
> IDEAL = [cgi paymethod], [cgi ideal_bank]<br>
> [/if]
>
> %2 [cgi paymethod]%
> [if cgi paymethod eq paypal ]
> PAYPAL
> [value name="mv_order_profile" value="paypal" hide=1]
> [value name="pp_use_billing_address" value="0" hide=1]
> [xbounce paypalsetrequest]
> [/if]
>
> %3 [cgi paymethod]%
> [if cgi paymethod eq vorkasse ]
> VORKASSE = [cgi paymethod]<br>
> [/if]
> [/if]
>
> Now, only paymethod="sofort" works. It does not matter whether that
> if-block is at the top of the four, or anywhere else. All other
> three options do never show their text! I have tried quotes around
> the keywords, eq -> = The do show the right value in the debug lines
> %0/%1/%2/%3
>
> Anyone?

Try using [then]

[if cgi paynow]
[then]
.....
[if cgi paymethod eq sofort]
[then]
......
[/then]
[/if]
[/then]
[/if]


If my memory serves me right you use [then] in case you have nested ifs ..

CU,

Gert


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


solutions at overmeer

Jul 17, 2013, 3:10 PM

Post #3 of 5 (49 views)
Permalink
Re: Simple if, why doesn't this work? [In reply to]

* Gert van der Spoel (gert [at] 3edge) [130717 21:38]:
> > -----Original Message-----
> > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-users-
> > bounces [at] icdevgroup] On Behalf Of Mark Overmeer
> > Sent: woensdag 17 juli 2013 23:02
> > To: interchange-users [at] icdevgroup
> > Subject: [ic] Simple if, why doesn't this work?
> >
> Try using [then]
>
> [if cgi paynow]
> [then]
> .....
> [if cgi paymethod eq sofort]
> [then]
> ......
> [/then]
> [/if]
> [/then]
> [/if]
>
> If my memory serves me right you use [then] in case you have nested ifs ..

Parsing horrible breaks with nested [then]s. Using it only on the
top-level doesn't help. Neither does adding it to the inner level.
--
Sorry,
MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer MARKOV Solutions
Mark [at] Overmeer solutions [at] overmeer
http://Mark.Overmeer.net http://solutions.overmeer.net

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


solutions at overmeer

Jul 17, 2013, 3:21 PM

Post #4 of 5 (49 views)
Permalink
Re: Simple if, why doesn't this work? [In reply to]

* Mark Overmeer (mark [at] overmeer) [130717 22:02]:
> I have spend a few hours in attempt to understand why this is not
> working, and I have not clue. Could be very obvious to an gifted
> IC developer.

Pfff, found it

> [if cgi paymethod eq sofort]

Works, no blank before ]

> [if cgi paymethod eq ideal ]
> [if cgi paymethod eq paypal ]
> [if cgi paymethod eq vorkasse ]

With blank, doesn't work... starts working when I remove the blank.

Is that something I should have known, or a (old) bug? Running
interchange 5.7.1
--
Thanks for reading,

MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer MARKOV Solutions
Mark [at] Overmeer solutions [at] overmeer
http://Mark.Overmeer.net http://solutions.overmeer.net

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


josh at perusion

Jul 18, 2013, 8:04 AM

Post #5 of 5 (47 views)
Permalink
Re: Simple if, why doesn't this work? [In reply to]

Quoting Mark Overmeer (solutions [at] overmeer):
> > [if cgi paymethod eq ideal ]
> > [if cgi paymethod eq paypal ]
> > [if cgi paymethod eq vorkasse ]
>
> With blank, doesn't work... starts working when I remove the blank.

If you're not going to quote, then it's a good guess that the space
becomes part of your match.

This would probably work:
[if cgi paymethod eq 'vorkasse' ]

--
Josh Lavin
Perusion -- Expert Interchange Consulting http://www.perusion.com/

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.