Examples (Using Pick Packets)
- Last UpdatedMar 11, 2024
- 2 minute read
The following examples show how a pick packet can be either defined directly to an event packet (edgPacket) or defined as a method against an object or form to be applied to an event packet within a utility.
Applied to an Event Packet
The Applied to an Event Packet example shows how a standard pick packet can be defined while defining an event packet.
|
-- Define event packet !packet = object EDGPACKET() -- Set Members !packet.description = 'Test Packet' !packet.key = 'testPacket' !packet.priority = 1 -- Defines action on completion of the pick !packet.action ='!action(!this.return[1])' -- Define pick sequence !packet.pickPacket.stdElement('Pick Element') -- Add event packet to the system !!edgCntrl.add(!packet) |
The pick packet definition can be either done using a standard method on the object (as above) or defined fully, where there is no standard method.
Method Definition
The Method Definition example is where an object/form has a method(s) that defines a pick packet sequence that can be applied to a standard event packet within the object/form.
The following is the definition of the method that defines the pick packet:
Method Definition
|
-- Define Method define method .elementMove() is EDGPICKPACKET -- Define pick packet !pickPacket = object EDGPICKPACKET() -- Define information !pickPacket.key = 'element-position' !pickPacket.description = 'Pick an element then a positions' -- Define primary prompt !pickPacket.prompt = 'Move element' -- Declare first pick (element) !pickPacket.picks[1] = object EDGPICKTYPE() !pickPacket.picks[1].stdElement('(Pick element to move)') -- Declare second pick (position) !pickPacket.picks[2] = object EDGPICKTYPE() !pickPacket.picks[2].stdPosition('(New position)') -- Return return !pickPacket -- End method definition endmethod |
The following is an extract on how the above method would be used within the owning object/form:
|
-- Define Packet !packet = object EDGPACKET() . . . -- Test for method if(!option eq 'MOVE") then !packet.pickPacket = !this.elementMove() else !packet.pickPacket = !this.elementBY() endif -- Add event to the system !!edgCntrl.add(!packet) - |