Being able to automate regression testing with PROCOMM is not impossible. This is how I managed to do it.
I want to be able to write to the DOS command line:
pw5 test.was PWEXIT
and have the PWEXIT argument be interpreted by my script to tell Procomm to shut down.
I also want to be able to use the Procomm GUI to run the test.was script.
Anyhow, here is how I do it.
1. When you run pw5 ( Procomm) from the command line, I0 contains the number of arguments being passed in. The strings S0 through S9 contain the arguments. Note: If the only argument is PWEXIT the string S0 will contain this text until it is written over.
2. By using I0, you can determine which of the strings S0 through S9 will be holding the last argument. So if I0 = 1 then I know that S0 will be holding the last argument. In my case I want to know if it is "PWEXIT".
3. Every script must do a "#INCLUDE common.inc" and the first line of this file should be:
STRING exitOnPWEXIT S0
QUESTION: Does anybody have a way to do the above in such a way that it would be something like S[I0-1], meaning I am
interested in using I0 - 1 to specify which S0 through S9 I wish to use?
4. In the common.inc file there has to be the procedure:
proc exitIfPWEXIT
if strcmp exitOnPWEXIT "PWEXIT"
pwexit
endif
endproc
5. The last line of every script you write must be:
exitIfPWEXIT()
6. The last thing is to build a .bat file that will allow running any number of Procomm scripts in a batch file.
7. The following is an example of my .bat file.
PW5.EXE EXEC_UTC_01.was PWEXIT
PW5.EXE EXEC_UTC_02.was PWEXIT
PW5.EXE EXEC_UTC_03.was PWEXIT
PW5.EXE EXEC_UTC_04.was PWEXIT
PW5.EXE EXEC_UTC_05.was PWEXIT
PW5.EXE EXEC_UTC_06.was PWEXIT
When you run this batch file from the dos command line, it will start procomm, run the test script and because the last argument was PWEXIT, will shut down procomm prior to doing the whole process again with the next .was script specified in the .bat file. This will also work with .wax files.
You will have to make sure that PW5.EXE ( procomm) is in your path.