HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 285

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 284
Pascal Preprocessor 261
A
Comments
The %list directive and the -l compiler option perform the same function.
Example
The Pascal program, list.p program list_example(output);
{ This program demonstrates the use of the %list
and %nolist directives. }
%list;
%include 'types.h';
%nolist;
begin
pri := [red, yellow, blue];
pos := [true, false];
cap := ['A'..'Z'];
dig := [0..100];
writeln('There are ',card(pri): 4, ' primary colors.');
writeln('There are ',card(pos): 4, ' possibilities.');
writeln('There are ',card(cap): 4, ' capital letters.'');
writeln('There are ',card(dig): 4, ' digits.')
end. { list_example }
Theinclude file, types.h type
lowints = 0..100;
primary_colors = set of (red, yellow, blue);
possibilities = set of boolean;
capital_letters = set of 'A'..'Z';
digits = set of lowints;
var
pri: primary_colors;
pos: possibilities;
cap: capital_letters;
dig: digits;
Przeglądanie stron 284
1 2 ... 280 281 282 283 284 285 286 287 288 289 290 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag