View previous topic :: View next topic
|
Author |
Message |
richie
New User
Joined: 11 Jun 2005 Posts: 24
|
|
|
|
Hi,
Please confirm my understanding on escape Bottom.
Escape Bottom executes the next line following the loop.
If i code an escape bottom between IF- ENDIF , then the statement after ENDIF would be executed.
So, in below ex MOVE *TIMN TO #TIME and below wud be excecuted .Please let me know if i understand it correctly.
Also how wud Escape Top work here if coded instead of Escape Bottom.
RD01.
READ (1) TABLE WITH KEY = #KEY
IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE BOTTOM
END-IF
*
MOVE *TIMN TO #TIME
IF #ISN=0
STORE A RECORD
ET
END-READ
Thankyou all for your help. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
ESCAPE (TOP, BOTTOM & ROUTINE) can be coded only within a loop or routine. They are not valid within IF.
O. |
|
Back to top |
|
|
Raj Kiran
New User
Joined: 24 Aug 2007 Posts: 3 Location: Chennai
|
|
|
|
Hi
the Escape bottom comes out of the IF-ENDIF(if the condition is true) and it wont execute the next statement
RD01.
READ (1) TABLE WITH KEY = #KEY
IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE BOTTOM
END-IF
*
MOVE *TIMN TO #TIME
IF #ISN=0
STORE A RECORD
ET
END-READ
in this code Escape bottom comes out of the Read and executes the next statement after the read
in the below example if u give escape top
RD01.
READ (1) TABLE WITH KEY = #KEY
IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE TOP
END-IF
*
MOVE *TIMN TO #TIME
IF #ISN=0
STORE A RECORD
ET
END-READ
it comes out of IF (if the condition is true) and again goes back to the read statement and doesn't go to the next statement(move statement)
and comes out of the read as u have given READ(1). if u have as READ it reads another record.
Hope u got it
Raj |
|
Back to top |
|
|
|