Getting Started with DECTPU 2.2 Invoking DECTPU from a DCL Command Procedure

Example 2–3 DCL Command Procedure INVISIBLE_TPU.COM

!This command procedure invokes DECTPU without an editor.

!The file GSR.TPU contains the edits to be made.

!Specify the file to which you want the edits made as p1.

$ EDIT/TPU/NOSECTION/COMMAND=gsr.tpu/NODISPLAY ’p1’

The DECTPU command file GSR.TPU, which is used as the file specification for the /COMMAND qualifier, performs a search through the current buffer and replaces a string or a pattern with a string. Example 2–4 shows the file GSR.TPU. GSR.TPU does not create or manipulate any windows.

Example 2–4 DECTPU Command File GSR.TPU

PROCEDURE global_search_replace (str_or_pat, str2)

!This procedure performs a search through the current

!buffer and replaces a string or a pattern with a new string

LOCAL src_range, replacement_count;

!Return to caller if string not found

ON_ERROR

msg_text := FAO (’Completed !UL replacement!%S’, replacement_count); MESSAGE (msg_text);

RETURN; ENDON_ERROR;

replacement_count := 0;

 

LOOP

 

 

src_range := SEARCH (str_or_pat, FORWARD);

! Search returns a range if found

ERASE (src_range);

! Remove first string

POSITION (END_OF (src_range));

! Move to right place

COPY_TEXT (str2);

 

! Replace with second string

replacement_count := replacement_count + 1;

 

ENDLOOP;

 

 

ENDPROCEDURE;

! global_search_replace

 

! Executable statements

input_file := GET_INFO (COMMAND_LINE, "file_name"); main_buffer:= CREATE_BUFFER ("main", input_file); POSITION (BEGINNING_OF (main_buffer)); global_search_replace ("xyz$_", "user$_"); pat1:= "" & LINE_BEGIN & "t";

POSITION (BEGINNING_OF (main_buffer)); global_search_replace (pat1, "T"); WRITE_FILE (main_buffer, "newfile.dat"); QUIT;

To use the DCL command procedure INVISIBLE_TPU.COM interactively, invoke it with the DCL command @ (at sign). For example, to use INVISIBLE_ TPU.COM interactively on a file called MY_FILE.TXT, type the following at the DCL prompt:

$ @invisible_tpu my_file.txt

You must explicitly write out any modified buffers before leaving the editor with QUIT or EXIT. If you use QUIT before writing out such buffers, DECTPU quits without saving the modifications. If you use EXIT, DECTPU asks if it should write the file before exiting.

Getting Started with DECTPU 2–5

Page 25
Image 25
Compaq AA-PWCBD-TE manual Example 2-3 DCL Command Procedure INVISIBLETPU.COM, Example 2-4 Dectpu Command File GSR.TPU

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.