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:

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 {
} catch (IOException e) {

//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 =;
    //Prints the Key     System.out.println("Key: " + valKeyObj); }
Any help (examples) are greatly appreciated. Thanks, Ben