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

Help with user input window for integers

Status
Not open for further replies.

M1PBXtech

Technical User
Jan 30, 2003
59
US
I would like to convert my script below to have 1 user input window that will prompt for Loop Number and the "NUM" integer start and finish values. I currently use this script by editing it each time I need it.

With my limited experience with user input windows I thought maybe someone might be able to help.

I also need a way to ask weather to send "ench %02d %02d" or "dsch %02d %02d".

Any Help would be appreciated.

Thanks
Ron


****************************
; this will enable or disable t-1 channels.
; Manually enter LD 60 before starting script
proc main



integer loop = 117 ;set loop number here
integer num
string sSend
for num = 1 upto 24 ;set the number of channels here
strfmt sSend "ench %02d %02d" loop num ; Edit ench/dsch and DTI loop as needed
transmit sSend
transmit "^M"
waitfor "." forever
endfor

strfmt sSend "stat %02d" loop





endproc
 
Here is a script that asks the user for the loop number. You could use a second sdlginput command, asking the user to enter 1 for "ench %02d %02d" or 2 for "dsch %02d %02d", check the value that was entered using strcmp, and branch appropriately (this would be the quick and dirty way), or you could use a small dialog with two radiobuttons for this question.

;****************************
; this will enable or disable t-1 channels.
; Manually enter LD 60 before starting script
proc main



integer loop ;set loop number here
integer num
string sSend
string sLoop

sdlginput "Enter loop number" "Enter loop number" sLoop
atoi sLoop loop

for num = 1 upto 24 ;set the number of channels here
strfmt sSend "ench %02d %02d" loop num ; Edit ench/dsch and DTI loop as needed
transmit sSend
transmit "^M"
waitfor "." forever
endfor

strfmt sSend "stat %02d" loop





endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top