|
Raynald,
You cannot run a script like yours from syntax. You can run it only by
Script|Run
command menu.
In the following lines:
While objSpssApp.IsBusy
'wait until spss processor is ready
Wend
objSpssApp.IsBusy will always return True, because the spss processor is
busy
until the syntax which calls the script is terminated!
In a code like this, you are telling to the script to wait until the end of
the syntax
that calls the script itself!
Your code will work *only* if you launch it by the Script|Run command.
I discovered (and I haven't found any description of this so far) that the
spss
commands sent to spss by script are executed *after* all commands of the
syntax containig the SCRIPT command, and *not*, as expected, within
the script.
Oh... I experienced this by using spss version 8.02 I don't know if in
version 9
spss acts differently.
Hope this helps,
Fabrizio
Raynald Levesque <rlevesque@VIDEOTRON.CA> on 15/05/99 17.52.48
Please respond to Raynald Levesque <rlevesque@VIDEOTRON.CA>
To: SPSSX-L@UGA.CC.UGA.EDU
cc: (bcc: Fabrizio Arosio/RRL/IT)
Subject: running SCRIPT.....
Dear list members
I have a script which does does not require input parameters. When I run it
with the run command there are no problems.
When I run it from a syntax file using the SCRIPT command, the status bar
shows "Running SCRIPTS" but nothing happens. The only way to regain control
is to terminate SPSS.
The problem occurs in the following loop of the Script:
<snip>
objSpssApp.ExecuteCommands strCommands, False
While objSpssApp.IsBusy
'wait until spss processor is ready
Wend
<snip>
The line before the loop creates a new variable. After the loop, the
variable is used. The While Wend loop is supposed to wait until the
processor has finished the creation of the variable before continuing with
the flow of the script. Without the loop, an error is produced when the new
variable is referenced because the processor has not finished creating it.
I trust above explanation is clear.
Any ideas to solve this problem?
TIA,
Raynald Levesque rlevesque@videotron.ca
|