<> <> <> <> <<>> DIRECTORY AlpsBool, MCCtl; MCOrder: CEDAR PROGRAM IMPORTS AlpsBool, MCCtl EXPORTS MCCtl = BEGIN OPEN AlpsBool, MCCtl; 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]]; <> 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; END.