Creating an instance of an MDM Document object
Next, create an instance of an MDM Document object.
1 Click the Functions tab to bring the Functions pane to the front, and then expand the Misc folder.
2 Right-click the CreateObject function, and then click Add Function.
This inserts the name of the function into the script.
3 Type an opening parenthesis:
(
This displays the function’s syntax, which shows that there is one parameter (the class) and that the function returns an object.
4 Type the parameter and the closing parenthesis:
"MDM.Document")
UNICOM Intelligence Professional highlights the opening and closing parentheses, and colors the text to distinguish the elements of the script. For example, different colors are used for keywords, variables, and literals.
5 On the next line type:
MDM.
(including the dot)
The ScriptAssist autosuggest feature displays the object's properties and methods.
6 Double-click the Open method.
This inserts the method into the script.
7 Type the opening parenthesis:
(
This displays the method's parameters. The parameter that you are on is in bold; you will use this parameter to specify the .mdd file to be opened. Optional parameters are shown in [ ] square brackets.
8 Type the name and location of the Short Drinks sample .mdd file. This is a text argument, so you must enclose it in quotation marks:
MDM.Open("[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Mdd\short_drinks.mdd")
9 Click the Types tab to bring the Types pane to the front.
The Types pane is similar to the Visual Basic object browser. It shows the properties and methods of all of the default objects. When you use the CreateObject function to create an instance of a UNICOM Intelligence Data Model or UNICOM Intelligence object, the Types pane also lists the objects in the associated type library. The MDM object was created from the MDM type library, which is called MDMLib.
10 Select MDMLib from the first list in the top left corner of the pane.
This restricts the list to the objects in the MDM type library.
There are tools on the Types pane toolbar that you can use to search and sort the list of objects and the list of an object’s members.
▪When you select an object, its members are displayed.
▪When you click a property or method, its syntax and other useful information (such as whether it is a read-only or read-write property) are displayed.
▪When you click a constant, its value is displayed.
Right‑click the Types pane to insert the property or method into the code.
Next
See also