DEC Text Processing Utility Program Development

5.2 Programming in DECwindows DECTPU

Setting Resources

When you use the SET (WIDGET) built-in procedure to pass a list to a widget, you must specify both the list name and the list count resource in the same array index, separated by a line feed (ASCII (10)). The array element should be the array that is to be passed. For example, to specify the "items" resource to the list box widget, use code similar to the following:

line_feed := ASCII (10);

resource_array {"items" + line_feed + "itemsCount"}:=list_array;

The line-feed character, ASCII (10), is a delimiter that separates two resource names.

DECTPU automatically generates two resource entries. The first is the array of strings that specifies the data to the list box for the "items" resource. The second is the count of elements in the array for the "itemsCount" resource.

Getting Resources

To get resource values from a widget, use the following statement:

GET_INFO (widget, "WIDGET_INFO", array)

The indices of the array parameter are strings or string constants that name the resources whose values you want. (The initial values in the array are unimportant.) The GET_INFO statement directs DECTPU to fetch the specified resource values of the specified widget and put the values in the array.

For list box widgets or file selection widgets, one element of the array receives another array that contains the list manipulated by the widget. The indices of this array are of type integer. The lowest index has the value 0, and each subsequent index is incremented by 1. The contents of the array elements are of type string.

When you create the index of the element that receives the widget’s list, you must observe the same naming convention as for setting resources so that DECTPU can handle both the list itself and the resource value that specifies the length of the list. Give the index the following format:

items<line-feed>items_count

For example, if you used GET_INFO (widget, "WIDGET_INFO", array) to get resource values from a list box widget, you could specify the index for the element storing the widget’s list as follows:

"items" + ASCII(10) + "itemsCount"

The element for the widget’s list does not actually contain an array until after execution of the GET_INFO statement. When DECTPU encounters the GET_ INFO statement, it parses the indices of the specified array. When DECTPU parses the index of the element for the widget’s list, it fetches both the list itself and the length of the list. Using the resource specifying the length, DECTPU creates an array of the correct size to hold the widget’s list.

See the DEC Text Processing Utility Reference Manual for sample uses of DECwindows DECTPU built-ins.

5–12DEC Text Processing Utility Program Development

Page 112
Image 112
Compaq AA-PWCBD-TE manual Setting Resources, Getting Resources

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.