HP SunSoft Pascal 4.0 Uživatelský manuál Strana 275

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 333
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 274
Pascal Preprocessor 251
A
Example
The %elseif Directive
The %elseif directive provides an alternative action to the %if directive.
Syntax
%if expression %then
.
.
%elseif expression %then
.
.
%endif
The Pascal program,
if_then_else.p
program if_then_else (output);
%var red
begin
%if red %then
writeln ('It is red.');
%else
writeln ('It is not red.')
%endif
end.
The output when you compile
if_then_else.p without the
-config
hostname% pc -xl if_then_else.p
hostname% a.out
It is not red.
The output when you supply
-config with the argument
red
hostname% pc -xl -config red if_then_else.p
hostname% a.out
It is red.
Zobrazit stránku 274
1 2 ... 270 271 272 273 274 275 276 277 278 279 280 ... 332 333

Komentáře k této Příručce

Žádné komentáře