HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 272

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 271
248 Pascal 4.0 Users Guide
A
Example
The Pascal program,
config.p, which defines the
conditional variables one and
two
program config_example(output);
{ This program demonstrates the use of the
%config compiler directive. }
var
a: integer := maxint;
b: integer := minint;
%var one two
begin
writeln('Begin program.');
%if one %then
writeln('One is defined as ', a:2, '.');
%elseif two %then
writeln('Two is defined as ', b:2, '.');
%elseif %config %then
writeln('Nothing is defined.');
%endif
writeln('End program.')
end. { config_example }
The output when you compile
config.p without the
-config option
hostname% pc -xl config.p
hostname% a.out
Begin program.
End program.
The output when you define the
variable one
hostname% pc -xl -config one config.p
hostname% a.out
Begin program.
One is defined as 32767.
End program.
Przeglądanie stron 271
1 2 ... 267 268 269 270 271 272 273 274 275 276 277 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag