Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (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'=""
    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
    Copy code to clipboard
FeedbackOpens in a new window