Pas2JS pascal source code
var
i: Integer;
numbers: array of Integer;
Begin
numbers.add(3);
numbers.add(0);
numbers.add(1);
numbers.add(2);
numbers.Delete(numbers.IndexOf(3));
for i := 0 to numbers.High do
WriteLn(numbers[i]);
type
TArray = array [0 .. 1] of String;
var av: array of TArray;
var buf: TArray := ['a', 'alpha'];
av.add(buf);
buf := ['b', 'beta'];
av.add(buf);
buf := ['g', 'gamma'];
av.add(buf);
av.Delete(0);
for i := 0 to av.High do
WriteLn(av[i][0] + ' - ' + av[i, 1]);
buf := ['a', 'alpha'];
av.add(buf);
av.Delete(0, 2);
for i := 0 to av.High do
WriteLn(av[i][0] + ' - ' + av[i, 1]);
{ <<< CONSOLE OUTPUTS >>>
0
1
2
b - beta
g - gamma
a - alpha
}
end;
var i = 0;
var numbers = [];
var av = [];
var buf = ["",""];
numbers.push(3);
numbers.push(0);
numbers.push(1);
numbers.push(2);
numbers.splice(numbers.indexOf(3),1)
;
var $temp1;
for(i=0,$temp1=numbers.length;i<$temp1;i++) {
WriteLn(numbers[i]);
}
buf = ["a", "alpha"];
av.push(buf.slice(0));
buf = ["b", "beta"];
av.push(buf.slice(0));
buf = ["g", "gamma"];
av.push(buf.slice(0));
av.shift();
var $temp2;
for(i=0,$temp2=av.length;i<$temp2;i++) {
WriteLn((av[i][0]+" - "+av[i][1]));
}
buf = ["a", "alpha"];
av.push(buf.slice(0));
av.splice(0,2)
;
var $temp3;
for(i=0,$temp3=av.length;i<$temp3;i++) {
WriteLn((av[i][0]+" - "+av[i][1]));
}