BenCroffut603954

Application Interface - VariableValues Class Usage

Discussion created by BenCroffut603954 on Aug 4, 2016
Latest reply on Sep 7, 2016 by Andrew_Garland_7890
Hi All,
 I'm able to open a Variable object and view it's keys but I can't seem to figure out how to loop through the values of each key. I've made a pretty big assumption that it's the VariableValues class but it does not have a constructor like other classes:

http://docs.automic.com/documentation/AE/10.0/english/AE_API/pages/com/uc4/api/objects/VariableValues.html

Example code for the Variable:
// Set Object to Variable Name UC4ObjectName Vara = new UC4ObjectName("VARA.AUTOMATION_SAVINGS");
// Open the UC4 Variable
OpenObject open = new OpenObject(Vara);
try {
    uc4.sendRequestAndWait(open);
} catch (IOException e) {
    e.printStackTrace();
}

//Open the Variable for reading
Variable UC4Variable = (Variable) open.getUC4Object();

//Iterate over the Variable to get keys
Iterator itr = UC4Variable.keyIterator();
while (itr.hasNext()) {
    Object valKeyObj = itr.next();
    //Prints the Key     System.out.println("Key: " + valKeyObj); }
Any help (examples) are greatly appreciated. Thanks, Ben

Outcomes