Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Metadata Model > Working with the Metadata Model: Tutorial > Getting the VariableInstance objects for a field
 
Getting the VariableInstance objects for a field
You can access all of the VariableInstance objects that relate to a particular field using the Variables property. All the different types of objects that can be contained in a Fields collection have a Variables property.
Example
This mrScriptBasic code displays the full names of all of the VariableInstance objects associated with the Rating grid in the Museum sample:
Dim MyDocument, MyVariableInstance

Set MyDocument = CreateObject("MDM.Document")

MyDocument.Open("C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Data\Data Collection File\museum.mdd", , _
MDMLib.openConstants.oREAD)

For Each MyVariableInstance In MyDocument.Fields["Rating.Column"].Variables
Debug.Log(MyVariableInstance.FullName)
Next
Results
rating[..].Column
rating[{Dinosaurs}].Column
rating[{Conservation}].Column
rating[{Fish_and_reptiles}].Column
rating[{Fossils}].Column
rating[{Birds}].Column
rating[{Insects}].Column
rating[{Whales}].Column
rating[{Mammals}].Column
rating[{Minerals}].Column
rating[{Ecology}].Column
rating[{Botany}].Column
rating[{Origin_of_species}].Column
rating[{Human_biology}].Column
rating[{Evolution}].Column
rating[{Wildlife_in_danger}].Column
rating[{Other}].Column
Next
Displaying a numeric variable in UNICOM Intelligence Interviewer - Paper
See also
Working with the Metadata Model: Tutorial