help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Wish list - an extended "if then else" statement


From: glpk xypron
Subject: Re: [Help-glpk] Wish list - an extended "if then else" statement
Date: Sat, 01 Jan 2011 13:50:00 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]