Solved

Check if an element parameter has a value

  • 4 August 2022
  • 1 reply
  • 126 views

Badge

Hello everyone, 

 

I have an Element Parameter PredecessorOperations(i_operation) that holds the value of the operation that has to be executed before i_operation. With the following statement i want to check if the EP has a value or not: 

 

if (val(PredeccesorOperation(i_operation)) = 0) then

….

endif;

 

However this only works if all values of the Ep are empty. If any operation gets assigned a predeccesor (e.g. Operation1) then i get the error: Cannot compute the value of string “Operation1”. 

If I would casually formulate the code it would look like this:

 

if( PredeccesorOperation(i_operation) is empty ) then 

….

endif;

So my question is: What operator do I need to use in order to check if the parameter has any value or no value assigned?

 

I am thankful for any advice you might have.

 

With kind regards

Andrew

 

icon

Best answer by Chris Kuip 5 August 2022, 08:01

View original

1 reply

Userlevel 5
Badge +7

Hi Andrew,

You can check whether predecessorOperation(i_operation) is empty by checking against the empty element '':

 

if predecessorOperation(i_operation) = '' then

 ….

endif ;

 

Hope this helps,

 

Chris

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator