advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
END Statement Details
  ◄Summary►  ◄Details►  ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 END [DEF | FUNCTION | IF | SELECT | SUB | TYPE | n%]
 
 Usage Notes
   ■ By itself, the END statement stops program execution, closes all files,
     and returns 0 to the operating system. In a compiled program, END
     returns control to the operating system; in Visual Basic, END returns to
     the programming environment.
 
   ■ The following table shows where END is required:
 
         Location                                        Required
         ═══════════════════════════════════════════     ═══════════════════ 
         End of a program                                No
         End of multiline DEF FN function definition     Yes
         End of a FUNCTION procedure definition          Yes
         End of a block IF...END IF statement            Yes
         End of a block IF TYPEOF statement              Yes
         End of a SELECT CASE block                      Yes
         End of a Visual Basic SUB procedure             Yes
         End of a user-defined type definition (TYPE)    Yes
 
   ■ You can place any number of END statements anywhere in the program to
     to stop execution.