Here is an example I came up with based on one of the sample scripts out of the help file. The way it works is that the value of the edit box (string variable TextStr) is displayed to the user when they click on the Exit button. If they answer Yes to the prompt, then the while loop is exited. If they say no, then the script drops through the rest of the case statement, and the while loop continues executing until the next dialog event.
proc main
string TextStr ; Text from dialog box.
integer Event ; Dialog box event.
integer iChoice
string sPrompt
; Define and display dialog with edit box.
dialogbox 0 0 0 100 70 11 "Edit Box Example"
editbox 1 5 5 90 40 TextStr MULTILINE
pushbutton 2 25 50 50 14 "E&xit"
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.
endcase
case 2 ; Exit event selected.
strfmt sPrompt "You entered %s, is that correct?" TextStr
sdlgmsgbox "Confirm choice" sPrompt QUESTION YESNO iChoice
if iChoice == 6
exitwhile ; Exit the loop.
endif
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."
endif
endproc