![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395132x1.png)
6
When you compile the Pascal routine without using the
The commands to compile and execute DayWeather.p and DayWeatherMain.c without
The commands to compile and execute DayWeather.p and DayWeatherMain.c with
hostname% pc
hostname% cc DayWeather.o DayWeatherMain.c
day = '' weather = ' sun'
hostname% pc
hostname% cc DayWeather.o DayWeatherMain.c
day = 'Sunday' weather = 'sunny'
The Pascal procedure,
VarRec.p
C equivalents of variant records can sometimes be constructed, although there is some variation with architecture and sometimes a need to adjust alignment. You can avoid the need to adjust alignment by using the
type
vr = record
case tag: char of
'a': (ch1, ch2: char);
'b': (flag: boolean);
'K': (ALIGN: integer);
end;
procedure VarRec(var x: vr); begin
if x.ch1 = 'a' then x.ch2 := 'Z'
end; { VarRec }
108 | Pascal 4.0 User’s Guide |