Order:
PUBLIC
PROC [table: TableOfVariables] =
BEGIN
order: ARRAY [0..2] OF Expression; -- the outputs; note they are not latched
mcmd10, mcmd12, other: Expression;
mcmd10 ← EqualInt[table, "MCmdxBA", 0, 3, 10];
mcmd12 ← EqualInt[table, "MCmdxBA", 0, 3, 12];
other ← Not[Or[table, mcmd10, mcmd12]];
Define the outputs and then add them to table
order[0] ← Or[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Not[Find[table, "wtProtectFlag"]]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Not[Find[table, "wtProtectFlag"]]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
other];
order[1] ← Or[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
other];
order[2] ← Nor[table,
And[table, mcmd10, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]],
And[table, mcmd12, Find[table, "arrayMatchxAB"], Find[table, "wtProtectFlag"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[0], name: "order[0]"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[1], name: "order[1]"]]];
AddOutput[table, NEW[OutputRec ← [expr: order[2], name: "order[2]"]]];
END;