Hands-On Exercise 6
You now know enough to add the following sections to your mylookup routine.
Add code to getsubmit to handle a full or partial phone number (Examples: 617, 617-621, or 617-621-0600). Write a phone procedure to display matches. Use the three argument form of $Order. Note: you may inadvertently introduce a bug when writing phone. The solution is in the step-by-step guide.
Add code to getsubmit to handle a full or partial name (Examples: Smith,John; Smith, J; Sm, John; Sm, J). Write a name procedure to display matches. Write a $$NameFormat user-defined function, that uses $$up and $$low functions (that you also write) to convert the last and first names into the proper format (pattern 1u.l), no matter how the user enters the name.
Update the help procedure with the additional options.
Keep track of the matches you display using a local array to associate the match number that the user sees with the ID number of the match. Modify all 3 search procedures (dob, phone, name) to use this local array. Write a select procedure to allow the user to choose a match. Modify display so that it accepts an additional argument, either “line” or “table”. Use “line” for displaying matches in a list horizontally, and “table” for displaying the user's single choice vertically, using display^mydatent(). Clear the screen before displaying data vertically.
For instructions, click below.