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

  • 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 135
112 Pascal 4.0 Users Guide
6
Value Parameters
There are three types of value parameters in Pascal.
Simple Types without –xl
Without –xl, simple types match, as in the following example:
The Pascal procedure,
SimVal. p. t, f, c, i, r, and s
are value parameters.
procedure SimVal(
t, f: boolean;
c: char;
si: integer16;
i: integer;
sr: shortreal;
r: real;
var reply: integer);
begin
Reply := 0;
if t then
Reply := Reply + 1;
if not f then
Reply := Reply + 8;
if c='z' then
Reply := Reply + 64;
if si=9 then
Reply := Reply + 512;
if i=9 then
Reply := Reply + 4096;
if sr=shortreal(9.9) then
Reply := Reply + 32768;
if r=9.9 then
Reply := Reply + 262144;
end; { SimVal }
Zobrazit stránku 135
1 2 ... 131 132 133 134 135 136 137 138 139 140 141 ... 332 333

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

Žádné komentáře