Design › Designing Server Procedures › Lesson Activity › Add Logic to MAINTAIN GOLFER › Add the CASE OF (COMMAND) Statement
Add the CASE OF (COMMAND) Statement
Now we can add the CASE OF (COMMAND) statement. Keep in mind that the CASE OF COMMAND statement is going to evaluate the value of the special system attribute COMMAND to determine which of five different actions we want performed. Those five actions include:
- Add (Register) Golfer
- Login Golfer
- Update Golfer
- Calculate Golfer Handicap Index
- Delete Golfer
Follow these steps:
- From the Main Menu, select Edit, then Add Statement, and then Case of …. In the Add Statement selection list, select command, then select the Complete push button, and then in the Add Statement selection list select command value.
The Toolset then brings up a list of the command values. While it is a complete list (for example, we can use the command CREATE to Add Golfer, UPDATE to Update Golfer, and DELETE to Delete Golfer), there are not any appropriate command values for Login Golfer or Calculate Golfer Handicap Index. Additionally, we can prefer to use a command of REGISTER for Add Golfer. We can add new command values to this default list.
- Select the Add Command… push button. In the Command Properties dialog New Name entry field, enter the new command value REGISTER and select the OK push button. If you have multiple adds turned on, it will add REGISTER to the list in the background while leaving the Command Properties dialog open. If you do not have multiple adds turned on, select the Add Command… push button once again. Either way, add the additional new commands of LOGIN and HANDICAP.
- When you are finished, select the Cancel push button in the Command Properties dialog if necessary to return to the Command Selection dialog. Then, select REGISTER from the list of command values, and then select the OK push button. Select CASE from the Add Statement selection list, select command value from the selection list, select LOGIN from the Command Selection list, and then select the OK push button.
- Repeat this process for the remaining three commands, UPDATE, HANDICAP, and DELETE. When you are finished, select the Add push button to add the CASE OF COMMAND statement to the action diagram.
Copyright © 2013 CA.
All rights reserved.
|
|