Assign Array (minus range)



Assign Array with negative range
Pas2JS pascal source code
var az: array[-1..1] of Integer; a: array[-3..- 1] of Integer; procedure minusONE(); var i: Integer; begin Writeln('minus one-based array'); for i := Low(az) to High(az) do begin az[i] := i; Writeln(IntToStr(i)); end; for i in az do Writeln(i); Writeln(az[-1]); Writeln(az[0]); Writeln(az[1]); end; procedure minusTWO() var i: Integer; begin Writeln('minus 3-based array'); for i := Low(a) to High(a) do begin a[i] := i; Writeln(IntToStr(i)); end; for i in a do Writeln(i); end; begin minusONE; Writeln('-----'); minusTWO; { minus one-based array -1,0,1 minus 3-based array -3,2,1 }