teletubby5e
Technical User
alright,
another bonehead question for the forum ......
I am trying to write a quick script to enter numbers into my switch to change or enter their hunting sequence. basically you have a telephone number "hunted from" (called num1) and the telephone number "hunted to" called (num2), and then it repeats for as long as there is not a null fileld in the "hunted to" (num2) string. i have it working now, but you have to input num1 and num2, then re-type num2 in the num1 field when it runs again. i would like to be prompted for the 1st number once, then the second number once, then have procomm pass the string value of num2 to become the value for num1, then prompt you for the new value of num2. so that when processing a list of 10 numbers in a hunt group, i only have to eenter in a total of 10 telephone numbers once each, instead of having to enter in 10 unique numbers (9 twice) for a total of 19 entries. many thanks for any help in this ....
PROC MAIN
STRING NUM1
STRING NUMHUNT
INTEGER ANSWER
STRING NUM2
STRING NUMHUNT2
TRANSMIT "RCV:APPTEXT!"
WAITFOR ": "
ANSWER = 1
WHILE ANSWER > 0
SDLGINPUT "TN" "ENTER NUMBER TO HUNT FROM:" NUM1
STRLEN NUM1 ANSWER
REPEET:
STRFMT NUMHUNT "TN=%.10s!" NUM1
SDLGINPUT "HUNT TO" "NUMBER YOU WANT IT TO HUNT TO:" NUM2
STRLEN NUM2 ANSWER
STRFMT NUMHUNT2 "SET=`"SERHLN`"&`"%s`"!" NUM2
IF STRCMP NUM2 ""
HALT
ELSE NUM1 = NUM2
GOTO REPEET
ENDIF
TRANSMIT "FORM=1V6&CHG!"
WAITFOR ": "
TRANSMIT NUMHUNT
WAITFOR ": "
TRANSMIT NUMHUNT2
WAITFOR ": "
TRANSMIT "CHG!"
WAITFOR ": "
ENDWHILE
another bonehead question for the forum ......
I am trying to write a quick script to enter numbers into my switch to change or enter their hunting sequence. basically you have a telephone number "hunted from" (called num1) and the telephone number "hunted to" called (num2), and then it repeats for as long as there is not a null fileld in the "hunted to" (num2) string. i have it working now, but you have to input num1 and num2, then re-type num2 in the num1 field when it runs again. i would like to be prompted for the 1st number once, then the second number once, then have procomm pass the string value of num2 to become the value for num1, then prompt you for the new value of num2. so that when processing a list of 10 numbers in a hunt group, i only have to eenter in a total of 10 telephone numbers once each, instead of having to enter in 10 unique numbers (9 twice) for a total of 19 entries. many thanks for any help in this ....
PROC MAIN
STRING NUM1
STRING NUMHUNT
INTEGER ANSWER
STRING NUM2
STRING NUMHUNT2
TRANSMIT "RCV:APPTEXT!"
WAITFOR ": "
ANSWER = 1
WHILE ANSWER > 0
SDLGINPUT "TN" "ENTER NUMBER TO HUNT FROM:" NUM1
STRLEN NUM1 ANSWER
REPEET:
STRFMT NUMHUNT "TN=%.10s!" NUM1
SDLGINPUT "HUNT TO" "NUMBER YOU WANT IT TO HUNT TO:" NUM2
STRLEN NUM2 ANSWER
STRFMT NUMHUNT2 "SET=`"SERHLN`"&`"%s`"!" NUM2
IF STRCMP NUM2 ""
HALT
ELSE NUM1 = NUM2
GOTO REPEET
ENDIF
TRANSMIT "FORM=1V6&CHG!"
WAITFOR ": "
TRANSMIT NUMHUNT
WAITFOR ": "
TRANSMIT NUMHUNT2
WAITFOR ": "
TRANSMIT "CHG!"
WAITFOR ": "
ENDWHILE