paxScript Demo. Sets.


paxBasic

Dim S As Set ' declare a set
S = [10, 20, 30]
Println 20 In S
S += [30, 40]   ' union
Println S
S -= [10] ' difference'
Println S
S *= [20, 30, 50] ' intersection
Println S
Println [20, 30] <= S 'subset

paxC

set S; // declare a set
S = [10, 20, 30];
println 20 in S;
S += [30, 40];   // union
println S;
S -= [10]; // difference
println S;
S *= [20, 30, 50]; // intersection
println S;
println [20, 30] <= S; // subset

paxPascal

var S: set of Integer; // declare a set
S := [10, 20, 30];
writeln(20 in S);
S := S + [30, 40];   // union
writeln(S);
S := S - [10]; // difference
writeln(S);
S := S * [20, 30, 50]; // intersection
writeln(S);
writeln([20, 30] <= S); // subset


Copyright © 1999-2006 VIRT Laboratory. All rights reserved.