MyProc: PW.UserProc =
BEGIN
-- Cells
a, b, test: PW.Object;
n: INT;
examples: PW.Design ← PW.OpenDesign["///PWExample.dale"];
n ← PW.RequestInt["How many elements in the array, please?"];
a ← PW.Get[examples, "a"];
b ← PW.Get[examples, "b"];
test ← PW.AbutX[a, b];
RETURN[test];
END;
TestMapFunction: PW.UserProc =
BEGIN
-- Cells
contact, noContact, edge, test: PW.Object;
BinaryCount:
PW.XYFunction =
{
RETURN[
SELECT
TRUE
FROM
y=0 => edge,
PW.XthBitOfN[y-1, x] => contact,
ENDCASE => noContact]};
examples: PW.Design ← PW.OpenDesign["///PWExample.dale"];
contact ← PW.Get[examples, "contact"];
edge ← PW.Get[examples, "edge"];
noContact ← PW.Inst[contact, LIST["contact"]];
test ← PW.MapFunction[BinaryCount, 0, 16, 0, 4];
RETURN[test];
END;