Skip to main content
Declined

Block keyword in if condition

Related products:AIMMS Language
  • January 10, 2023
  • 5 replies
  • 21 views

Forum|alt.badge.img+3

I would like to use blocks in the condition of if statements to make them more easily understandable.

Let me know if you would like more details.

5 replies

Jess Es
Forum|alt.badge.img+6
  • Grand Master
  • September 22, 2023

Hi Zsolt, this is not doable for the near future. Unless we see huge demand for this from other users it is unlikely we would implement, but we can leave it open for discussion. In the meantime we’d suggest the usual workarounds (comments, spacing...)


Jess Es
Forum|alt.badge.img+6
  • Grand Master
  • September 22, 2023
NewDiscussion ongoing

gabiservidone
Administrator
Forum|alt.badge.img+6

Hi @Zsolt Mihály, this Idea will be Declined. Talking to our PO, adding blocks into conditions is not a advisable way to code. The best practice is to separate and pre-calculate bits of your complex condition before using as a condition. This best practice is at the majority of times even more performatic.  

 

This is an example on how to organize fors with complex conditions. Here I have two pre-calculated local parameters that are then used on the for condition.  

 

Hope this helps!

 


gabiservidone
Administrator
Forum|alt.badge.img+6
Discussion ongoingDeclined

Forum|alt.badge.img+3
  • Author
  • AIMMS Partner
  • April 8, 2024

Hi @gabiservidone , your answer makes sense. Thank you!


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

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