[Pas2js] 2d array bug?

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Oct 5 22:19:54 CEST 2021


On Tue, 5 Oct 2021 15:59:03 -0400
"nick's hardware" <nickshardware2020 at gmail.com> wrote:

> using Pas2JS Compiler version 2.0.6 [2021/04/15] for Win32 i386
> 
> Program test;
>   uses browserconsole;
> 
> type
>   ta = array[0..1,0..1] of integer;
> var
>   a1 : ta;
>   a2 : ta;
> begin
>   a1[0,0]:=10;
>   a1[0,1]:=10;
> 
> //make a copy of array
>   a2:=a1;
> 
> //modify the copy
>   a2[0,0]:=99;
>   a2[0,1]:=99;
> 
> //print contents of original array - it should print 10 10 - but it
> prints 99 99 //this works normally with single dimension array. have
> not tested with three dimensional
>   writeln(a1[0,0]);
>   writeln(a1[0,1]);
>  end.

This has been fixed last week in the development version of pas2js.

Mattias



More information about the Pas2js mailing list