Rapid code is not working.

Trying to add value to the variable - 'number', and if 'number' == 5 then do message box. Not working. My variable remains in 0.
My PROC:
PROC user_selection()
        VAR num answer;
        VAR num number;
        
        VAR btnres answer2;
        
         !Testing TPReadFK and IF, IFELSE statements.
         !PulseDO\PLength:=1.5, doFeedBkwd_W1_R1;
        
         !can be up to 5 uptions. If less then 5 write - stEmpty
        TPReadFK answer,"Select which way to go","Left","Right","Center","CheckLoop","Dispose Mudule";
        
        IF answer=1 THEN
            Pth_2_left;
            number := number + 1;
        ELSEIF answer=2 THEN
            Pth_3_right;
            number := number + 1;
        ELSEIF answer=4 THEN
            t_LogicLoopStop;
            number := number + 1;
        ELSEIF answer=5 THEN
            disposeModule;
            number := number + 1;
        ELSE
            Pth_1_center;
            number := number + 1;
        ENDIF
        
        IF number = 5 THEN
            UIMsgBox\Header:="UIMsgBox Header","Number is 5"\MsgLine2:=""\MsgLine3:=""\MsgLine4:=""\MsgLine5:=" "\Buttons:=btnOKCancel\Icon:=iconInfo\Result:=answer2;
        IF answer = resOK disposeModule;
        ENDIF
        !
    ENDPROC 

What I'm doing wrong?

Best Answer

Answers

Sign In or Register to comment.