Hands-On Exercise 4
The best way to understand what's happening with the globals ^PersonD (for data) and ^PersonI (for indexes) is to try it yourself while building the completed version of ObjectScript.DataEntry4.
Add a line to Main() that calls the Store() method after Display().
Add a line to ValidPhone() that checks to see if the phone number already exists in the phone index.
Copy the complete Store() method (from the second Storage Method page) into your class.
Save and compile. Then run Main(), and store one person's data.
Look at the globals. Use the Management Portal in the USER namespace. Click System Explorer > Globals, find the entries for ^PersonD and ^PersonI, and click View for each one.
Run Main() again, and store a few more people. Look at the globals again, especially ^PersonI.
For instructions, click below.