- Assigned to a graphical user interface object (such as a push button or menu item)—Assign a command to the GUI object only if you would like it assigned to any action that would take place with the object.
You will not usually assign a command to the object since there may be several events associated with a single object. There may be an event associated with clicking the object, double-clicking the object, bringing the object into focus, and so on.
- Assigned to an event associated with a GUI object—This is the typical mechanism of assigning commands:
- If the command is associated with an event, and a remote use of a server is executed in the event, the server procedure can evaluate the command and perform the correct logic.
- If the command is associated with an event, and the exit state is set to cause a flow, and if you have defined the command to be “current” on the flow, the command will be carried to the server.
The logic in the server will evaluate the command to understand what the user is trying to accomplish.
- Assigned along a flow—A command can be set along a flow, which means that every time that flow is executed, the command will always be the same.
This will not be a typical use of setting the command for client/server or client/client procedure interactions.
- Set to current along a flow—For client/server and client/client procedure interactions, you will typically set the command to current along the flow.
Since most of the flows in client/server design are links, you typically set to current in both directions of the flow. This does not assign a value to the command. It simply allows the value of the command to remain the same from the source procedure to the destination procedure as the flow is executed.
- Set to “previous” along a return link flow—Although you will typically set the command to current on the return link flow, you could set the command to whatever the command was when the send flow was executed. This means that if the command were changed in the destination procedure for some processing, it would be changed back to whatever is was when the send flow was executed. This allows you to know what command was sent to the destination procedure.
This will become more useful as server-to-server flows are implemented.
- Set it in a logic statement—There is a procedure logic statement that sets the command whenever logic is being executed. For more information about how commands are set by a procedure logic statement, see the chapter “Designing the Procedure Logic.”
You will have many reasons to set the value of the command in the logic.