DEC Text Processing Utility Program Development

5.6 Using DECTPU Startup Files

Example 5–5 Source Code for Minimal Interface to DECTPU

!MINI.TPU - minimal DECTPU interface PROCEDURE tpu$init_procedure

!Create a buffer and window for messages

message_buffer := CREATE_BUFFER ("Message Buffer"); SET (NO_WRITE, message_buffer);

SET (SYSTEM, message_buffer);

SET (EOB_TEXT, message_buffer, "");

message_window := CREATE_WINDOW (21, 4, OFF); MAP (message_window, message_buffer);

! Create a buffer and window for SHOW

show_buffer := CREATE_BUFFER("Show Buffer"); SET (NO_WRITE, show_buffer);

SET (SYSTEM, show_buffer);

info_window := CREATE_WINDOW (1, 20, ON);

! Create a buffer and window for editing

main_buffer := CREATE_BUFFER ("Main Buffer"); main_window := CREATE_WINDOW (1, 20, ON); MAP (main_window, main_buffer);

!Create an area on the screen for prompts SET (PROMPT_AREA, 21, 1, NONE);

!Put the editing point in the main buffer

POSITION (main_buffer); tpu$local_init;

ENDPROCEDURE;

PROCEDURE tpu$local_init !Procedure to allow end users !to add private extensions

ENDPROCEDURE;

!Define the minimal editing keys:

DEFINE_KEY ("SPLIT_LINE", RET_KEY);

DEFINE_KEY ("ERASE_CHARACTER(-1)", DEL_KEY);

DEFINE_KEY ("EXECUTE(READ_LINE(’DECTPU Statement: ’))", TAB_KEY); DEFINE_KEY ("EXIT", Ctrl_Z_KEY);

!Create a section file and then quit

IF (get_info/system,("operating_system")=ULTRIX)

THEN save(’/usr/user/jacki/mini.tpu_section’);

ELSE save(’sys$login.mini);

ENDIF

QUIT;

! End of MINI.TPU

If you created the section file SYS$LOGIN:MINI.TPU$SECTION, you could use the procedures and definitions in that file as an interface to DECTPU. To invoke DECTPU with SYS$LOGIN:MINI.TPU$SECTION as the MINI section file, use the following command:

$ EDIT/TPU/SECTION=SYS$LOGIN:MINI your_text.fil

You can define the logical name TPU$SECTION to point to your section file. By default, DECTPU looks for a file that TPU$SECTION points to and reads that file as the default section file.

5–22DEC Text Processing Utility Program Development

Page 122
Image 122
Compaq AA-PWCBD-TE Example 5-5 Source Code for Minimal Interface to Dectpu, $ EDIT/TPU/SECTION=SYS$LOGINMINI yourtext.fil

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.