Dear community members,
in one method i'm trying to insert a repeat_until structure whithin an if_ then structure.
The method seems to not recognize it and breacks the if_then structure as shown in the picture.
As you can see, on the left there isn,t any line.
Why does it happen?
The reason the method doesn't recognize the repeat structure is because you are missing a second end. You have created two If structures and hence you need two ends to finish them.
Your structure should be more like this
If variableWait = "Yes" then
If nextp.nummu < 1 then
until nextp.nummu > 0;
I am not sure where you want the move to parallelproc so you might want it placed between the two Ends
Looking at your code there is nothing intrinsically wrong with it (I set variableWait = "yes" and saw if the code ran) and it seems to be working well (although it might run infinitely, described later on). However your code will currently never enter the repeat or while areas as your model doesn't get to variablewait = "yes".
This is because there seems to be an error in the VarWait code. Specifically at the line:
if str_to_obj(buffnames[1,i]).nummu >= str_to_obj(buffnames[2,i]).levelingQuantity
There is nothing wrong with the code itself but when you get to i=4, buffnames[2,i] is now a blank entry as you only have 3 Mus listed. Therefore buffnames[2,4] = "" and the str_to_obj is blank and an error comes up.
This codes work fine at beginning as you have just 3 buffers listed in buffnames but I think you add extra rows in parallelEntry code and this causes your problems above.
In terms of your called by calledByPull code you might get an infinite loop in the repeat and while parts of the code.
This is because while you are setting a different buffer with nextp:=z, if the buffer doesn't have any MUs in it then this will go on infinitely. Time stops while code is being run and therefore no MUs can enter the buffer until the code stops (or you move MUs to a buffer using move in the code). So the code will keep repeating infinitely.
Does that make sense?
Sorry about that , I did see that Steffan had answered most of what I wrote in your other thread afterwards, so glad you got those problems sorted.
If you could send your current model, I could see if the repeat works or not on my computer as not something I have come accros before.
From what I saw in the model your repeat statement would never trigger because your condition was never going to become true.
After tracking a bit the problem was in your VarWait method
You had something like:
if str_to_obj(buffnames[1,i]).nummu >= str_to_obj(buffnames[2,i]).levelingQuantity then
and need something like:
if (buffnames[1,i]/="" and str_to_obj(buffnames[1,i]).cont/=void) and
str_to_obj(buffnames[1,i]).nummu >= str_to_obj(buffnames[1,i]).cont.levelingQuantity then
One to prevent the error Ollie mentioned and two because the value in table buffnames[2,1] you are reading will never return the value of levelingQuantity.
Now after that comes the deadlock in your wait statement in the calledbypullmethod but the statement work as programmed.
I'm adding your model with the modifications I mentioned.