Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

演習 2 : 2 番目のデータ入力ルーチン

  1. スタジオを開始し、mydatent ルーチンを開きます。

  2. 以下の 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
        }
FeedbackOpens in a new tab