HPlogo Command Interpreter Access and Variables Programmer's Guide: Series HP 3000 Computer Systems > Chapter 5 Using Language Constructs Available with CI

Returning to Calling Environment

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The RETURN command exits a command file or UDC and returns to the calling process, whether it is the CI, an application, or another UDC or command file. This provides a mechanism for creating an error routine. The following routine tests that a parameter is a positive integer. If not, an error message is displayed, and control is returned to the calling environment.

   PARM COUNT, P2=" ", P3=" "

   IF TYPEOF(!COUNT) <> 1 OR !COUNT < 0 THEN

     ECHO Expected a positive integer for COUNT

     RETURN

   ENDIF

The ESCAPE command can also be used to exit a command file or UDC. Unlike RETURN, ESCAPE causes control to leave all UDCs or command files, regardless of nesting levels, and returns to the CI prompt. If a jobstream invokes the command, the job is flushed from the system.

Feedback to webmaster