![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395251x1.png)
10
Here is an example that illustrates the style of programming with the XView interface in Pascal. This program:
•Creates a vertical scrollbar with a view length of 100 pixels
•Changes the view length to 200 pixels
•Destroys the scrollbar
var bar, pi: Scrollbar;
begin
bar := xv_create ( 0, SCROLLBAR, 0 ); pi := xv_create_l ( 0, SCROLLBAR,
attr_create_list_4s ( SCROLLBAR_VIEW_LENGTH, 100, SCROLLBAR_DIRECTION, SCROLLBAR_VERTICAL));
set_SCROLLBAR_VIEW_LENGTH( bar, 200 ); xv_destroy ( bar );
In this example:
•
•
•
•
bar is declared to be of type Scrollbar.
xv_create() and xv_create_l() are invoked as functions. set SCROLLBAR_VIEW_LENGTH () is invoked as a procedure. xv_destroy() is invoked as a procedure.
Conversion of C to Pascal
Here is an example of a problem that you may encounter when converting C to Pascal. It recommends some changes that you can make to work around the problem.
An ExampleThe
The XView Toolkit | 227 |