![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395120x1.png)
6
The commands to compile and execute SimVar.p and SimVarMain.c
hostname% pc
hostname% a.out
00000001 00000000 z 9 9 9.9 9.9
The Pascal procedure,
StrVar.p
With the
The C counterpart to the Pascal alfa and string types are arrays; C passes all arrays by reference. The C counterpart to the Pascal varying is a structure; C passes structures by value.
Before you call Pascal with a null varying string, set the byte count to zero because that is what Pascal assumes about such strings.
C can pass a structure consisting of a
See the following example:
type
TVarStr = varying [25] of char;
procedure StrVar( var a: alfa; var s: string; var v: TVarStr);
begin
a := 'abcdefghi' + chr(0);
s := 'abcdefghijklmnopqrstuvwxyz' + chr(0); v := 'varstr' + chr(0);
end; { StrVar }
96 | Pascal 4.0 User’s Guide |