I’m trying to update our AIMMS model to the latest software version as it is long overdue - we were previously using version 4.1 and now want to update to 4.71.
I’m very new to the AIMMS language so am being stumped by the following error message that appears when I open the model in 4.71:
“A definition cannot as a side effect change another identifier. The third argument of intrinsic function “StringToElement” should be set to 0 explicitly.”
The piece of code that relates to this error message is
{ (tpehis,pe) | FormatString("%e",pe) = StringToElement(Periods,SubString(FormatString("%e",tpehis),1,4) + "-" + SubString(FormatString("%e",tpehis),5,6) ,1)};
From what I can pick up from the manual, in the StringToElement function, a value of 1 creates the element.
This piece of code works perfectly fine in the 4.1 version of AIMMS.
Why is this error occurring and how can I fix this?
Thanks.