Hello,
is there a way that dynamic arrays can be created (using schemata) which are GLOBAL, i.e. not accessible in the sole main program, but also in all functions and procedures included in it? For instance this little piece of code gives me this error:
espon.pas: In procedure `Merce': espon.pas:50: undeclared identifier `Vett' (first use in this routine) espon.pas:50: (Each undeclared identifier is reported only once espon.pas:50: for each routine it appears in.) espon.pas:50: subscripted object is not an array or string
the code follows:
program skifo;
type
TVecDob (Size: Integer) = array [ 1 .. Size ] of double; PVecDouble = ^TVecDob;
Function Power ( base: real; espon: integer ): double;
var
i, j: integer;
buff: real;
begin
buff := base;
for i :=1 to espon - 1 do begin
buff := buff * base;
end;
result := buff;
end;
Procedure merce;
var
i,j: integer;
begin
for i := 1 to 10 do begin
writeln (' vett ', i, '=', vett [i] );
end;
end;
var
nelem, i, j : integer;
begin
nelem := 10;
var vett: TVecDob ( nelem );
for i := 1 to 10 do begin
vett [i] := 1+0.1*i;
end;
merce;
end.
Thank you very much
Silvio