HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 202

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 333
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 201
178 Pascal 4.0 Users Guide
8
The FORTRAN main program,
VarRecmain.f. The variable
ALIGN is integer*2, and is
needed to match the Pascal
variant record layout.
structure /a_var/
character ch1, ch2
end structure
structure /b_var/
character flag
end structure
structure /c_var/
integer*2 ALIGN
end structure
structure /var_part/
union
map
record /a_var/ a_rec
end map
map
record /b_var/ b_rec
end map
map
record /c_var/ c_rec
end map
end union
end structure
structure /vrnt/
character tag
record /var_part/ var_rec
end structure
record /vrnt/ VRec
VRec.var_rec.a_rec.ch1 = 'a'
VRec.var_rec.a_rec.ch2 = 'b'
call varrec ( VRec )
write ( *, * ) VRec.var_rec.a_rec.ch2
stop
end
The commands to compile and
execute VarRec.p and
VarRecmain.f without –xl
hostname% pc -c VarRec.p
hostname% f77 VarRec.o VarRecmain.f
VarRecmain.f:
MAIN:
hostname% a.out
b
Vue de la page 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 332 333

Commentaires sur ces manuels

Pas de commentaire