0

I update some fields with external procedure ( i cannot modify base program ) .

I try to jump over field I need, but on one, my program is freezing. The procedure looks like that:

   PAUSE 0 NO-MESSAGE.

    IF FOCUS = field1
    THEN DO:
        field1:screen-value    = ''.
        APPLY 'ENTER' .
        PAUSE 0 .
    END. 

    IF FOCUS = field2
    THEN DO:
        field2:screen-value       = 'U'.
        APPLY 'ENTER' .
        PAUSE 0 .
    END.     

    IF FOCUS = field3
    THEN DO:
        field3:screen-value       = 'N'.
        APPLY 'ENTER' .
        PAUSE 0 .
        APPLY 'ENTER' .
        PAUSE 0.
    END.  

    PAUSE 0.

I put PAUSE 0, because its solve similiar case when I was in field2, but in field3 its not working. What others step I can make? Thank You for answers. Regards.

e: When i said "Freeze" i mean Its waiting for any key. After 'any key' it goes onwards. Its problem, because i neet to automatize evrything .

e: And now i guess its not after APPLY statement but in some moment when i jumping over the fields. When i normally use the original program this freeze/waiting for key is unseen. So what in the code above can cause such an effect?

e: Its after APPLY "ENTER" on specific fields. Not for evry but some fields causes freezing ( not with Press Space message ). Pause 0 not working for them.

e: After using only this code :

IF FOCUS = field1 
THEN DO: 
     APPLY 'ENTER' .  
     APPLY 'COMPLETE' TO FOCUS. 
     PAUSE 0.
     MESSAGE 'dfdfd' VIEW-AS ALERT-BOX.
END.

Its freezing after showing the message. Dont know why...

6
  • Chances are the "entry" event in this code is triggering the original "entry" trigger to fire again, which is why you're in an infinite loop.
    – Tim Kuehn
    Dec 18, 2013 at 23:54
  • Im sure its not loop. Its not freezing permanent. Its only stop and waiting only for space bar ( but its not "Press space bar..." message ) . And its not doing on all fields but only on few. Rest of fields are working normally. And this is only event on all of this fields.
    – Wiktor
    Dec 19, 2013 at 11:13
  • 1
    In which case I'll need to see sample program which demonstrates this behavior.
    – Tim Kuehn
    Dec 19, 2013 at 12:08
  • I'm sorry Tim, I cant give You demonstrate.
    – Wiktor
    Dec 20, 2013 at 11:42
  • I'm sorry Tim, I cant give You demonstrate with original program bu t i will try to build one with that effect.
    – Wiktor
    Dec 20, 2013 at 12:17

1 Answer 1

0

You've applied "enter". So your code must RETURN NO-APPLY or it is going to undo the application of ENTER.

1
  • Thank You for answer. Unfortunately It doesn't help. I think that maybe original program is starting external procedure with some conflict parameter.
    – Wiktor
    Jan 14, 2014 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.