Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see How to Migrate to InterSystems IRIS, available on the WRC Distributions page (login required).

Exercise 2: Second Data Entry Routine

  1. Start Studio, and open the mydatent routine.

  2. Enter the following ObjectScript:

    mydatent ; second data entry routine
    
    main ; main loop section
        do {
            do prompt()
            quit:(name = "")
            do display()
        }
        while name'=""
        quit
    
    prompt() [name, phone, dob]
        {
        ; procedure for prompting
        read !, "Name: ", name
        quit:(name="")  ; user entered nothing
        read !, "Phone: ", phone
        read !, "DOB: ", dob
        write !!
        }
    
    display() [name, phone, dob]
        {
        ; display the data
        write !, "Name:", ?20, name
        write !, "Phone:", ?20, phone
        write !, "DOB:", ?20, dob
        }
Feedback