Set a scalar value from a parameter values,

Hi,
I try to set a scalar value from a parameters value. I got an error message about uncontrolled set. Could anyone help me please?

sets
SE /s1*s4/
;
parameters
scenDone(SE)
/s1 0
s2 1
s3 0
s4 0/
;
scalar
temp1
/0/
;
temp1 = scenDone(SE) $ (ord(SE) eq 2);


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Hi Omid



You should either write something like:

Temp1 = scenDOne(“s2”)

Or use a loop:

Loop(SE$$ (ord(SE) eq 2),

Temp1 = scenDone(SE);

);



Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of omid ziaee
Sent: Freitag, 8. Januar 2016 06:47
To: gamsworld
Subject: Set a scalar value from a parameter values,



Hi,
I try to set a scalar value from a parameters value. I got an error message about uncontrolled set. Could anyone help me please?

sets
SE /s1*s4/
;
parameters
scenDone(SE)
/s1 0
s2 1
s3 0
s4 0/
;
scalar
temp1
/0/
;
temp1 = scenDone(SE) $ (ord(SE) eq 2);


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Thank you for your suggestion. I found another way,
temp1 = sum (SE $ (ord(SE) eq 2, scenDone(SE));
Thanks,

On Friday, January 8, 2016 at 1:31:26 AM UTC-6, Renger van Nieuwkoop wrote:

Hi Omid



You should either write something like:

Temp1 = scenDOne(“s2”)

Or use a loop:

Loop(SE$$ (ord(SE) eq 2),

Temp1 = scenDone(SE);

);



Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of omid ziaee
Sent: Freitag, 8. Januar 2016 06:47
To: gamsworld
Subject: Set a scalar value from a parameter values,



Hi,
I try to set a scalar value from a parameters value. I got an error message about uncontrolled set. Could anyone help me please?

sets
SE /s1*s4/
;
parameters
scenDone(SE)
/s1 0
s2 1
s3 0
s4 0/
;
scalar
temp1
/0/
;
temp1 = scenDone(SE) $ (ord(SE) eq 2);


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.