[Top][All Lists]

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

Re: [Help-glpk] [Fwd: Help in if Statement]

From: Andrew Makhorin
Subject: Re: [Help-glpk] [Fwd: Help in if Statement]
Date: Thu, 12 May 2011 17:00:30 +0400

> I have a code that you can see it below, it does'nt seem to have error
> but when i compile it in GLPK the error is:
> "right parenthesis missing where expected
> Context: } printf ( if ( Selected [ i ] == 1 and c < 1 ) then c :=
> MathProg model processing error"
> for {i in Items}
>         printf(if (Selected[i]==1 and c<1)  then (c:=1 & "display: %d\n
> \n")),i;
> c is a variable that its value is zero first.
> I want to make it 1 when I see the first 1 in Selected.
> Selected is an array  that has binary value.(var
> Selected{Items},binary;)
> can anyone help me to fix this problem

The construction you use in the printf statement is syntactically
incorrect. Please explain in words what exactly do you need to model. 
Note that MathProg is not a procedural language. For example, unlike
programming languages it has no assignment statement.

reply via email to

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