ESCAPE IMMEDIATE

Hi all,

What is the difference between an ESCAPE BOTTOM and an ESCAPE IMMEDIATE statement??

Rahul

The Natural documentation says:

Example:

define data local
01 view-name view of ddm-name
  02 ab
end-define
*
read view-name
  at end of data
    write '--- END OF LIST ---'
  end-enddata
*
  write view-name
*  
  if *COUNTER >= 10
*    escape bottom immediate  /* uncomment this line for a test
    escape bottom
  end-if
end-read
end

rahul_mf, sometimes I get the feeling, that you think asking is easier than searching for the answers yourself!

Do you see the link that reads “Documentation” on top of this page? If not, you can look here: http://developer.softwareag.com/ets/docu/nat_docu.htm. If you do not find an answer there, you can ask your questions in this forum.

Matthias,

What actually does “loop-end processing” means ???

As I wrote:

at end of data ...

Matthias,

Does it mean that if in the above code the read statement does not contain the loop-end processing (in this cae “at end of data” statement)
then in that case both ESCAPE BOTTOM and ESCAPE IMMEDIATE will do the same function,i.e.,we can use either of them.

Yes!

But remember that an “ESCAPE IMMEDIATE” leads to a Natural Syntax Error (NAT0192). You have to write one of the following statements:

ESCAPE ROUTINE IMMEDIATE
ESCAPE MODULE IMMEDIATE

Thanks a lot Matthias :smiley:

Also:
ESCAPE BOTTOM IMMEDIATE

That is, IMMEDIATE is an option to modify the ESCAPE BOTTOM/ROUTINE/MODULE clauses. IMMEDIATE bypasses non-procedural code such as AT BREAK, AT END, etc.

Last week I realized that the processing of AT END OF PAGE is obviously not influenced by IMMEDIATE. Is there a special reason for this behaviour?

In my opinion AT END OF PAGE is not influenced by IMMEDIATE because AT END OF PAGE does not relate to a particular loop. Thus it is not part of the loop-end-processing.
Only the AT conditions which relate to the ESCAPEed loop are affected by the IMMEDIATE.