Cool!  Thank you!  A bit of a kludge, but a lot better than my kludge.

-----Original Message-----
From: glpk xypron [mailto:[email protected]]
Sent: Saturday, January 01, 2011 7:50 AM
To: Meketon, Marc; [email protected]
Subject: Re: [Help-glpk] Wish list - an extended "if then else" statement

Hello Marc,

> for{(time,ad) in EVENTS} {
>   if ad='A' then printf "dual=%3g  %5d\n", ARRIVALS[time].dual, time
>
>   else printf "          %5d dual=%3g\n", time, DEPARTURES[time].dual;
> }
>
> but that doesn't work.

This is the closest you can get with the existing syntax:

for{(time, ad) in EVENTS} {
  printf{ i in {1} : ad == "A" }
    "dual=%3g  %5d\n", ARRIVALS[time].dual, time;
  printf{ i in {1} : ad != "A" }
    "%5d dual=%3g\n", time, DEPARTURES[time].dual; }

Best regards

Xypron

--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone
----------------------------------------------------------------------------
This e-mail and any attachments may be confidential or legally privileged.  If 
you received this message in error or are not the intended recipient, you 
should destroy the e-mail message and any attachments or copies, and you are 
prohibited from retaining, distributing, disclosing or using any information 
contained herein.  Please inform us of the erroneous delivery by return e-mail.

Thank you for your cooperation.
----------------------------------------------------------------------------


This e-mail and any attachments may be confidential or legally privileged. If 
you received this message in error or are not the intended recipient, you 
should destroy the e-mail message and any attachments or copies, and you are 
prohibited from retaining, distributing, disclosing or using any information 
contained herein.  Please inform us of the erroneous delivery by return e-mail. 
Thank you for your cooperation.

_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to