Skip to main content
Solved

How to interrupt a procedure with an if condition?

  • November 8, 2021
  • 1 reply
  • 50 views

afattahi
Forum|alt.badge.img+4

Hi,

 

I want to interrupt a procedure with an if condition. For example:

if (a condition) then

   TestProcedure1;

else

   *interrupt current procedure;

endif;

 

I know I can use BREAK; to stop the loops. But how can I stop a procedure?

Best answer by MarcelRoelofs

@afattahi 

 

Depending on what you want, you can call the “return” statement with or without a return value, or if you want to indicate an error, you can call “raise error ...” which you can then subsequently catch in a block-on-error statement.

 

1 reply

MarcelRoelofs
AIMMSian
Forum|alt.badge.img+5
  • AIMMSian
  • 107 replies
  • Answer
  • November 8, 2021

@afattahi 

 

Depending on what you want, you can call the “return” statement with or without a return value, or if you want to indicate an error, you can call “raise error ...” which you can then subsequently catch in a block-on-error statement.

 



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

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