Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying User Inputs

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
Is there a Way to Display 3 User Inputs in ONE Dialog Box??

Current Script

Code:
main Proc
string TextStr, TextStr2, TextStr3                             ; Text from dialog box.
integer Event, Event2, Event3                                                  ; Dialog box event.
dialogbox 0 183 77 136 61 11 "    Enter New Traffic Password" 
   editbox 1 17 9 97 9 TextStr 8 
   pushbutton 4 43 29 50 14 "E&xit" OK DEFAULT
enddialog 
   while 1
      dlgevent 0 Event     ; Read dialog event.
      switch Event         ; Evaluate dialog event.
         case 0            ; No event occurred.
         endcase
         case 1            ; Edit box was changed.
            disable DLGCTRL 0 1
         endcase
         default           ; Exit event selected.
            exitwhile      ; Exit the loop.
         endcase
      endswitch
   endwhile
   dlgdestroy 0 CANCEL     ; Destroy dialog box.
   if not nullstr TextStr  ; See that TextStr isn't empty.
      usermsg "You typed:`r`r%s" TextStr
   else
      usermsg "No text entered."
      exit
   endif
dialogbox 0 183 77 136 61 11 "        Enter Traffic Start Time" 
   editbox 2 17 9 97 9 TextStr2 5 
   pushbutton 4 43 38 50 14 "E&xit" OK DEFAULT
   text 5 37 22 56 12 "Example:  07:00" left 
enddialog 
   while 1
      dlgevent 0 Event2                                  ; Read dialog event.
      switch Event2                                      ; Evaluate dialog event.
         case 0                                          ; No event occurred.
         endcase
         case 2                                          ; Edit box was changed.
            disable DLGCTRL 0 2
         endcase
         default                                         ; Exit event selected.
            exitwhile                                    ; Exit the loop.
         endcase
      endswitch
   endwhile
   dlgdestroy 0 CANCEL                                   ; Destroy dialog box.
   if not nullstr TextStr2                               ; See that TextStr isn't empty.
      usermsg "You typed:`r`r%s" TextStr2
   else
      usermsg "No text entered."
      exit
   endif

dialogbox 0 183 77 136 61 11 "        Enter Traffic Stop Time" 
   editbox 3 17 9 97 9 TextStr3 5 
   pushbutton 4 43 38 50 14 "E&xit" OK DEFAULT
   text 5 37 22 56 12 "Example:  07:00" left 
enddialog 

   while 1
      dlgevent 0 Event3                                  ; Read dialog event.
      switch Event3                                      ; Evaluate dialog event.
         case 0                                          ; No event occurred.
         endcase
         case 3                                          ; Edit box was changed.
            disable DLGCTRL 0 3
         endcase
         default                                         ; Exit event selected.
            exitwhile                                    ; Exit the loop.
         endcase
      endswitch
   endwhile
   dlgdestroy 0 CANCEL                                   ; Destroy dialog box.
   if not nullstr TextStr3                               ; See that TextStr isn't empty.
      usermsg "You typed:`r`r%s" TextStr3
   else
      usermsg "No text entered."
      exit
   endif

usermsg "New Traffic Passwordis:`r`r%s" TextStr
usermsg "Traffic Collection START Time is:`r`r%s" TextStr2
usermsg "Traffic Collection STOP Time is:`r`r%s" TextStr3
endproc
I want to Combine the 3 User Messages at the Bottom into ONE Dialog Box. Is This Possible??
 
You could combine all three usermsg commands into one usermsg command. You might need to juggle the `r and `n characters to get the formatting to come out right, but it should work for you. Just make sure that the variables at the end of the usermsg statement correspond with the correct %s format variable in the format string.
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top