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

Dialog Box & goto help 1

Status
Not open for further replies.

Improviz

Technical User
Jun 9, 2005
5
0
0
US
Hi. I program an SL100 and we frequently put what we call "busy lamps" onto admin sets. Essentially, we make their boss's prime line an SCA MDN key, then put a non-ringing copy of that key onto the admin's set, with DOR & DTM. This will then show them when their boss is on the phone.

I have a script that will do 1 key. What I'm trying to do is make it so a dialog box comes up and asks if you want to add another key before the script ends. If you say yes, I need to let the user enter new string values for the BSYDN and for the ADMINSETKEY strings, then re-run the rest of the script. (The NCOS and the LEN variables will not change). If you say no, then script would terminate. I'm guessing some kind of IF/elseif statment based on the valu returned by a pushbutton in the dialogbox and a gogo, but I've not had much luck figuring out the dialog box stuff. I'm not really a programmer but I can make Aspect do the simple stuff. Attached is the script I am using. Thanks for any help.
proc Main


string BSYDN
string ADMINLEN
string BSYDNNCOS
string ADMINSETKEY

sdlginput "LEN of Admin Set (Incl. HOST, MTRO):" "LEN: " ADMINLEN
sdlginput "NCOS:" "NCOS: " BSYDNNCOS

sdlginput "DN of Busy Lamp (4 DIGIT):" "DN: " BSYDN
sdlginput "Key For Busy Lamp:" "KEY: " ADMINSETKEY

transmit "new $ 432"
transmit BSYDN
transmit " m2616 fh y visa_ocw 0 "
transmit BSYDNNCOS
transmit " 650 "
transmit ADMINSETKEY
transmit " n^M"
waitfor ">"
transmit ADMINLEN
transmit " "
transmit ADMINSETKEY
transmit " mdn sca n $ y^M"
endproc
 
Oops, I meant "goto", not gogo, in my original post. Thanks.
 
What you can do is enclose the parts of the script that may need to get repeated inside a while 1/endwhile loop, then use the sdlgmsgbox toward the end of the loop to ask the user if they want to continue or not. If they click the Yes button, iChoice will be 6 and the script will jump to the end (and then the beginning) of the while loop. Otherwise, the script will exit out of the while loop and end. I have made most of the changes below, you should just need to put the appropriate commands in place of the sdlgmsgbox command.

string BSYDN
string ADMINLEN
string BSYDNNCOS
string ADMINSETKEY
integer iChoice

sdlginput "LEN of Admin Set (Incl. HOST, MTRO):" "LEN: " ADMINLEN
sdlginput "NCOS:" "NCOS: " BSYDNNCOS

while 1
sdlginput "DN of Busy Lamp (4 DIGIT):" "DN: " BSYDN
sdlginput "Key For Busy Lamp:" "KEY: " ADMINSETKEY

transmit "new $ 432"
transmit BSYDN
transmit " m2616 fh y visa_ocw 0 "
transmit BSYDNNCOS
transmit " 650 "
transmit ADMINSETKEY
transmit " n^M"
waitfor ">"
transmit ADMINLEN
transmit " "
transmit ADMINSETKEY
transmit " mdn sca n $ y^M"
sdlgmsgbox ...
if iChoice == 6
loopwhile
else
exitwhile
endif
endwhile
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top