Cancel
Showing results for 
Search instead for 
Did you mean: 

Method Failure

Creator
Creator

Hello

 

i`ve got a question. I wrote this method..but it doesnt work (syntax error).

Could you please help me to find my failure?

 

is
do
    if ?.nf(1).belegt=false
    then ?.inhalt.umlagern(?.nf(1));
        
    elseif ?.nf(1).belegt=true and ?.nf(2).belegt=false
    then ?.inhalt.umlagern(?.nf(2));
        
    elseif ?.nf(1).belegt=true and ?.nf(2).belegt=true
    then waituntil ?.nf(1).belegt=false;
        @.umlagern(?.nf(1));    
    end;
end;

 

Thanks and Best regards

Konstantin

2 REPLIES

Re: Method Failure

Honored Contributor
Honored Contributor

nf is a method, you cannot use it inside of a waituntil statement, but you can use a object variable to avoid this

is
n:object do if ?.nf(1).belegt=false then
?.inhalt.umlagern(?.nf(1)); elseif ?.nf(1).belegt=true and ?.nf(2).belegt=false then
?.inhalt.umlagern(?.nf(2)); elseif ?.nf(1).belegt=true and ?.nf(2).belegt=true then n:=?.nf(1); waituntil n.belegt=false prio 1; @.umlagern(n); end; end;
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Method Failure

Creator
Creator

Thanks Steffen! Its working.