Date: Sat, 27 Sep 2003 17:57:00 -0400
Reply-To: Raynald Levesque <rlevesque@videotron.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@videotron.ca>
Subject: Re: script+Macrorun+factor componant analysis (answer to Q#1)
In-Reply-To: <20030927145718.1361.qmail@web60208.mail.yahoo.com>
Content-type: text/plain; charset=iso-8859-1
Hi
This answers only question #1:
One solution is to
-replace
call travail()
by
call travail(strpath, strFileName)
- and replace
sub travail()
by
sub travail(strPath as String,strFileName as String)
Regards
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS site: http://pages.infinit.net/rlevesqu/
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
boulsaien khaled
Sent: September 27, 2003 10:57 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: script+Macrorun+factor componant
analysis+nvokeDialogAndExecuteSyntax:from new SPSS user
ASSALAM ALAIKOUM
Hi, Iam Khaled
*************************Question N° 1******************
this is a slice of my script:
-----------------------------------------------------------------
sub main
dim selection as integer
Dim strPath As String
Dim strFileName As String
'NB: selection is an integer variable (en realité ce script est une portion
d'un grand script et "selection"
' fait partie du grand script )
select case selection
case 0
'***********les données necessaires (the data that we need)*****************
Dim objDataDoc As ISpssDataDoc
Set objDataDoc = objSpssApp.OpenDataDoc ("C:\Documents and
Settings\Kaled\Bureau\stage-ingenieur\don.3éme.sav)
strPath = "C:\Documents and
Settings\Kaled\Bureau\stage-ingenieur\RE_enquête\3éme\"
strFileName = "graphes.3éme.spo"
call travail()
case 1
'***********les données necessaires (the data that we need)*****************
Dim objDataDoc As ISpssDataDoc
Set objDataDoc = objSpssApp.OpenDataDoc ("C:\Documents and
Settings\Kaled\Bureau\stage-ingenieur\don.4éme.sav)
strPath = "C:\Documents and
Settings\Kaled\Bureau\stage-ingenieur\RE_enquête\4éme\"
strFileName = "graphes.4éme.spo"
call travail()
end select
end sub
sub travail()
Dim objOutputDoc As ISpssOutputDoc
Set objOutputDoc=objSpssApp.NewOutputDoc
'
'*********************************le travail (work to
do)*******************************
Dim strCommand As String
strCommand = strCommand & "GRAPH /PIE=PCT BY q81 /MISSING=REPORT."
objSpssApp.ExecuteCommands strCommand, True
'*******************************
objOutputDoc.SaveAs( strPath & strFileName)
objOutputDoc.Visible =True
end sub
-------------------------------------------------------------
-------------> the problem is :what I define in the main sub is not
recognized in the travail sub (in other words the new
output document has not the strfilename "graphes.3éme.spo" that I define in
the main sub)
<snip>