HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 251

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 250
The XView Toolkit 227
10
Coding Fragment
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
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 Example
The Problem—Besides the six standard generic procedures, there are
approximately 80 other procedures, plus hundreds of attributes. These are all
documented in the XView Programming Manual. The problem is that all of the
coding is in C.
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 );
Przeglądanie stron 250
1 2 ... 246 247 248 249 250 251 252 253 254 255 256 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag