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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog box question- simple sdlginput

Status
Not open for further replies.

flyinfishman

Technical User
Oct 24, 2006
2
US
Simple question I hope:
I'm fairly new at Aspect when it comes to doing anything other than just transmitting simple commands.

When I bring up a standard dialog box with OK and Cancel buttons, if I should hit cancel I want the dialog box to close and script to stop completely.

I've looked at a few sample scripts, but when I hit cancel instead of OK the script just keeps on going.
thanks,
 
From Aspects on-line help: (modified a little)

Where the 'errormsg "Host didn't respond!"' line is, replace this with your termination code.

Code:
proc main

string Name                ; String to contain user name.

   transmit "^M"              ; Get host's attention.
 
                              ; prompt and get user's name.
   if sdlginput "Information" "User Id: " Name
      transmit Name           ; Transmit users name followed by
      transmit "^M"           ; carriage return.
   else
      errormsg "Host didn't respond!"
     
   endif



endproc
 
Sorry, should have mentioned:

Code:
else
     errormsg "Host didn't respond!"
     exit
endif
[\code]

exit will end the program.
 
Thanks...The answer was staring right at me since that's where I looked originally.

I'm getting cross eyed learning this stuff.
time to do the aspect tutorials...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top