type PortState = enum Open, Closed PortItem = object port: int state: PortState # A simple container for PortItems type PortList = seq[PortItem] # Add a new port to the list proc addPort(portList: var PortList; newPort: PortItem) = portList.add(newPort) # Modify an existing port in the list proc modifyPort(portList: var PortList; portNum: int; newState: PortState) = for i in 0..