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!

Questions about Parent scripts 1

Status
Not open for further replies.

CustomerResearch

Programmer
May 6, 2003
7
US
Hello

I'm using ProCom and Aspect scripts to log into remote computers and download information. For the most part the scripts that I've made work fine on their own but we want to set up a parent script to run the various children scripts. I set up an "all scripts" script that executes all of the various smaller scripts in succession. The problem is when I get a dialing error (busy signal, operator, etc) the child script it got hung up on doesn't kick back out to the parent script. Any tips?

;parent script
proc main
execute "blahblah.wax"
execute "somethingelse.wax"
endproc

;blahblah.wax
dial DATA "blahblah"
;script stuff

;somethingelse.wax
dial DATA "somethingelse"
;script stuff

Thanks
 
You can use the $CARRIER variable in your child script to check if the connection was successful and the $CNCTMSG variable to determine the reason for connection failure.

By using an exit code ie. exit 42 in your child script, you can let parent know the status of the child. The parent then can check the $EXITCODE variable to determine whether child was successful or failed.

See examples below.

Example of mainscript.wax
Code:
proc main
execute "child1.wax"  ; Execut child script.
if $EXITCODE == 1     ; If the exit code for a dialing failure is received,
   errormsg s0        ; display an error dialog with the reason for the 
                      ; dialing failure and continue with error handling
                        
else                  ; If no errors received from child, continue script.

endif
endproc



Example of child1.wax
Code:
proc main
dialnumber DATA "7654321" ; Dial Number
while $DIALING            ; Pause while dialing number.
   yield
endwhile
if $CARRIER               ; If successful connection, continue running script.


   exit 0                 ; If script runs without errors, set exit code to let 
                          ; parent know that script execution was successful.
else
   s0=$CNCTMSG            ; If connection fails, set a global variable to
                          ; contain the error message.
                              
   exit 1                 ; Set exit code to let parent know that 
                          ; connection failed.
endif
endproc
 
Would doing something like this work?

<child script>

dial DATA &quot;MY Jeep&quot; ;This changes for every Dealer
if failure
goto end
endif
while $dialing
endwhile

<all the dialing stuff>

end:
endproc

-------------------------------
Brian, Customer Research Inc
 
That would work to some degree, but the parent script would have no idea of the final status (connection made or not) of the child script. Mrnoisy's script does give that sort of feedback to the parent script. Also, one problem you may run into with either script is if Procomm displays a popup message that the script is not expecting. My memory is rusty on if Procomm display any error messages in a message box that coule pause execution of the code (such as number busy, etc.), but from your first message that sounds like the situation you are running into. Is that correct?


aspect@aspectscripting.com
 
Not quite... you see we're trying to set up these scipts to download information from numerous clients. Right now this is done MOSTLY manually and is very time consuming. I have made aspect scripts that are able to go into two types of systems (R&R and ADP) and automate what was previously done manually. Of course these scripts had to be made for every client (40-60 depending).

Regardless if the information download is automated or not it is still VERY time consuming. A couple of our clients take 45 minutes to download from WITH the automated script. The hope is that someone at the end of the night can open up procom, launch parent script, and go home. If one or two of the clients don't get downloaded from, that's fine. When someone comes in the next morning they can download the other two dealerships (instead of 40).

To answer you busy signal question, no. When my version of procom runs into a busy signal I just get the blue splash screen with &quot;Procom plus ready&quot; at the top. My problem has been that the child script has continued to execute without a connection and of course gets hung up.

I'm going to try and implement the first examply you gave with the error reporting. I'll report back when I get a result.

-------------------------------
Brian, Customer Research Inc
 
I used the above example without the error reporting and it works! My scripts are running MUCH more smoothly now. Thanks a lot, MrNoisy and Knob!

-------------------------------
Brian, Customer Research Inc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top