User Guide

643
SPSS Scripting
Facility
Using the Object Browser
E From the script window menus choose:
Debug
Object Browser...
E
Select an object class from the Data Type list to display the methods and properties
for that cla
ss.
E Select pro
perties and methods for context-sensitive Help or to paste them into your
script.
New Procedu
re (Scripting)
A procedure
is a named sequence of statements that are executed as a unit. Organizing
code in procedures makes it easier to manage and reuse pieces of code. Scripts must
have at least one procedure (the
Main subroutine) and often they have several. The
Main proce
dure may contain few statements, aside from calls to subroutines that
do most of the work.
Figure 46
-14
New Proced
ure dialog box
Procedures can be subroutines or functions. A procedure begins with a statement that
specifies the type of procedure and the name (for example, Sub Main or Function
DialogMonitor( )
) and concludes with the appropriate End statement (End Sub
or End Function).
As you scroll through the script window, the name of the current procedure is
displayed at the top of the script window. Within a script, you can call any procedure
as many times as you want. You can also call any procedure in the global script file,
which makes it possible to share procedures between scripts.