MyFlight
Technical User
- Feb 4, 2002
- 193
I have a script file that runs and I need to choose between 2 possibilities. I tried using the When Target Command, However, this will not work. If I use the WHEN TARGET Command, the script does not completly process the Last Extension. In addtion if I receive an ERROR, because ONE extension is not in the System. I cannot hit Enter to continue, because then when the file is finished it keeps scrolling.
I want to accomplish the Following while reading Values from a File (i.e. within a while not feof command).
If I receieve the following from the Port: "No Valid Match"
Go to the Next entry in the file (fgets 1 sLine) and continue processing script.
If the Extenison is (Valid) Found I want to finish the steps within the while feof.
NOTE: the WHEN TARGET Commands cover all of the Prompt I receeive after a Valid Extension is Found, upto and After the PassWord Prompt.
Example:
;HERE IS WHERE THE PROBLEM IS
while not feof 1
setjmp 0 sNext
fgets 1 sLine
strtok sTok1 sLine "," 1
; Assigns Text in First Field (in Text File) to Variable sTok1.
strreplace sLine " " " "
waitfor "Subscriber Name or Extension: "
; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System.
transmit sTok1
transmit "^M"
if waitfor "PhoneMail Password : (Previous = ##########): "
transmit szNewPswd
Pause 1
endif
endwhile
endif
fclose 1
transmit ";^M"
waitfor "Function: " forever
transmit "LOG^M"
waitfor "Action: " forever
transmit "LOG^M"
capture OFF
hangup
endproc
proc Announce
pause 1
transmit "F T F^M"
endproc
proc Exit_MailBox
pause 1
transmit ";^M"
endproc
proc New_MailBox
integer sNext = 0
sNext = 0
longjmp 0 sNext
endproc
proc Press_Enter
pause 1
transmit "^M"
endproc
If this does not make sense and/or you need more information, please let me know.
You assistance is greatly appreciated.
I want to accomplish the Following while reading Values from a File (i.e. within a while not feof command).
If I receieve the following from the Port: "No Valid Match"
Go to the Next entry in the file (fgets 1 sLine) and continue processing script.
If the Extenison is (Valid) Found I want to finish the steps within the while feof.
NOTE: the WHEN TARGET Commands cover all of the Prompt I receeive after a Valid Extension is Found, upto and After the PassWord Prompt.
Example:
Code:
proc main
string CapPath ="C:\Program File\Procomm Plus\Download\"
string szNewPswd,szSiteName,sTok1,sLine
string sEnter = "^M"
integer sNext
sdlginput "Site Name" "Enter Site Name:" szSiteName ; Assigns Site Name to the Variable szSiteName
pause 1
sdlginput "New Password" "Enter the New DEFAULT Password:" szNewPswd ; Assisgns Password to szNewPswd
pause 1
strcat szNewPswd sEnter ; Adds and Enter to the szNewPswd Variable
when Target 0 "Extension [" call Press_Enter
when Target 1 "Name (last first) :" call Press_Enter
when Target 2 "Class Number :" call Press_Enter
When Target 3 " Enter T or F for each field): " call Announce
When Target 4 "Group Name :" call Press_Enter
When Target 5 "Referral Extension : " call Press_Enter
When Target 6 "Volume Level : " call Press_Enter
When Target 7 "Speed level : " call Press_Enter
When Target 8 "Abbreviated Prompts?: " call Exit_MailBox
; Verifies that My Site.txt File does Exist.
if isfile "C:\Temp Data Files\Raw Data\My Site.txt"
; Opens Text File My Site.txt
fopen 1 "C:\Temp Data Files\Raw Data\My Site.txt" READ TEXT
; This will bring you to the PhoneMail Modify prompt in the system
waitfor "Function: " FOREVER
transmit "PROFILE^M"
waitfor "Action: "
transmit "MODIFY^M"
while not feof 1
setjmp 0 sNext
fgets 1 sLine
strtok sTok1 sLine "," 1
; Assigns Text in First Field (in Text File) to Variable sTok1.
strreplace sLine " " " "
waitfor "Subscriber Name or Extension: "
; Sends the Text Value (Assigned to Variable sTok1) to the PhoneMail System.
transmit sTok1
transmit "^M"
if waitfor "PhoneMail Password : (Previous = ##########): "
transmit szNewPswd
Pause 1
endif
endwhile
endif
fclose 1
transmit ";^M"
waitfor "Function: " forever
transmit "LOG^M"
waitfor "Action: " forever
transmit "LOG^M"
capture OFF
hangup
endproc
proc Announce
pause 1
transmit "F T F^M"
endproc
proc Exit_MailBox
pause 1
transmit ";^M"
endproc
proc New_MailBox
integer sNext = 0
sNext = 0
longjmp 0 sNext
endproc
proc Press_Enter
pause 1
transmit "^M"
endproc
If this does not make sense and/or you need more information, please let me know.
You assistance is greatly appreciated.