Escape bottom and Escape Bottom Immediate



Software AG's platform-independent programming language with full support for open-source and Internet applications

Escape bottom and Escape Bottom Immediate

Postby diptisaini » Wed Nov 02, 2011 5:45 pm

Hi,

I just want to know what is the difference between Escape Bottom and Escape Bottom Immediate. Can anyone explain me with an example?

Immediate Option:
If you specify the keyword IMMEDIATE, no loop-end processing will be performed.

I am not able to understand what the meaning of loop-end processing? When we have to use immediate and when not ?????/
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Escape bottom and Escape Bottom Immediate

Postby NicC » Thu Nov 03, 2011 1:43 am

Did you look up loop-ending processing?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Escape bottom and Escape Bottom Immediate

Postby RGZbrog » Thu Nov 03, 2011 12:21 pm

Loop-end processing refers to AT END OF DATA and AT BREAK statements. The keyword IMMEDIATE means that you don't want Natural to invoke the AT END OF DATA nor to force a final break.

An example without IMMEDIATE:
DEFINE DATA LOCAL
1 EMP    VIEW EMPLOYEES
  2 PERSONNEL-ID
END-DEFINE
READ EMP BY PERSONNEL-ID FROM '11100108'
  AT BREAK OF PERSONNEL-ID /7/
    WRITE 5X '1 break'
  END-BREAK
  AT END OF DATA
    WRITE 5X '1 end data'
  END-ENDDATA
  /*
  WRITE '1' PERSONNEL-ID
  IF  *COUNTER = 5
    THEN
      ESCAPE BOTTOM
  END-IF
END-READ
END

1 11100108
1 11100109
     1 break
1 11100110
1 11100111
1 11100112
     1 break
     1 end data
 

The same example with IMMEDIATE:
DEFINE DATA LOCAL
1 EMP    VIEW EMPLOYEES
  2 PERSONNEL-ID
END-DEFINE
READ EMP BY PERSONNEL-ID FROM '11100108'
  AT BREAK OF PERSONNEL-ID /7/
    WRITE 5X '2 break'
  END-BREAK
  AT END OF DATA
    WRITE 5X '2 end data'
  END-ENDDATA
  /*
  WRITE '2' PERSONNEL-ID
  IF  *COUNTER = 5
    THEN
      ESCAPE BOTTOM IMMEDIATE
  END-IF
END-READ
END

2 11100108
2 11100109
     2 break
2 11100110
2 11100111
2 11100112
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time


Return to Natural