Lexical Elements of the DEC Text Processing Utility Language

4.9Reserved Words

RETURN—This language statement stops the execution of the procedure in which the error occurred but continues execution of the rest of the program.

If you do not specify ABORT or RETURN, the default is to continue executing the program from the point at which the error occurred.

DECTPU provides two forms of error handler: procedural and case style.

4.9.4.15 Procedural Error Handlers

If a WARNING status is trapped by an ON_ERROR statement, the warning message is suppressed. However, if an ERROR status is trapped, the message is displayed. With the ON_ERROR trap, you can do additional error handling after the DECTPU message is displayed.

Syntax

ON_ERROR statement_1; statement_2; . . . statement_n; ENDON_ERROR;

Example 4–10 shows error statements at the beginning of a procedure. These statements return control to the caller if the input on the command line of an interface is not correct. Any warning or error status returned by a statement in the body of the procedure causes the error statements to be executed.

Example 4–10 Procedure That Uses the ON_ERROR Statement

!

!Gold 7 emulation (command line processing)

PROCEDURE command_line

LOCAL line_read, X;

ON_ERROR

MESSAGE ("Unrecognized command: " + line_read);

RETURN; ENDON_ERROR;

!

!Get the command(s) to execute

line_read := READ_LINE ("DECTPU Statement: "); ! get line from user

!compile them

!

IF line_read <> ""

THEN

X := COMPILE (line_read);

ELSE

RETURN ENDIF;

!

!execute

IF X <> 0

THEN

EXECUTE (X);

ENDIF;

ENDPROCEDURE;

The effects of a procedural error handler are as follows:

If you press Ctrl/C, DECTPU places an error message in the message buffer, exits from all currently active procedures (in their reverse calling order), and returns to the ‘‘wait for next key’’ loop.

4–24Lexical Elements of the DEC Text Processing Utility Language

Page 90
Image 90
Compaq AA-PWCBD-TE manual Procedural Error Handlers, Example 4-10 Procedure That Uses the Onerror Statement

AA-PWCBD-TE specifications

The Compaq AA-PWCBD-TE is a highly regarded laptop battery designed to provide reliable power to a range of Compaq laptop models. As technology continues to evolve, the necessity for efficient and long-lasting batteries becomes increasingly important, especially for students, professionals, and anyone reliant on portable computing.

One of the standout features of the AA-PWCBD-TE is its impressive capacity, designed to enhance the performance of your device. With a power capacity of around 5200 mAh, this battery is engineered to provide extended usage times, allowing users to work on the go without frequent interruptions for recharging. The battery supports efficient energy management, contributing to the overall longevity of the device.

Additionally, the AA-PWCBD-TE integrates advanced lithium-ion technology, which is favored for its reliability and minimal memory effect. Lithium-ion batteries typically offer a higher energy density compared to older technologies, meaning they can store more energy in a smaller size. This technology also supports faster charging times, making it a convenient solution for busy users.

Safety is another vital characteristic of the AA-PWCBD-TE. It features built-in protection against overcharging, overheating, and short-circuit conditions, which helps ensure the safety of both the battery and the device itself. This level of protection is crucial, especially in professional environments where equipment failure can lead to productivity losses.

Compatibility is also a key aspect of the AA-PWCBD-TE, as it is designed to fit a variety of Compaq laptop models. Users can easily determine whether this battery is suitable for their specific model, simplifying the buying process and ensuring optimal performance.

In terms of weight and dimensions, the AA-PWCBD-TE is designed to be lightweight and compact, adding minimal bulk to the laptop while still delivering powerful performance. Users can enjoy the balance of efficiency and portability, making it an ideal choice for those who travel frequently or require a battery that doesn't compromise on power.

Overall, the Compaq AA-PWCBD-TE stands out as a dependable and efficient laptop battery that enhances the user experience. With its impressive capacity, cutting-edge technology, and safety features, it is a valuable accessory for anyone looking to improve their mobile computing capabilities.