
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
Java | size: 0.67 KB | hits: 38 | expires: Never
public void onExecute() throws Exception
{
int count = 0 ;
int highSlot = 0 ;
int lowSlot = 0 ;
Property[] slots = getProgram().getPropertiesArray(); // get slots into an array
for(int i=0; i < slots.length; i++) {
if ( (slots[i].getName().startsWith("bIn")) && (slots[i].getType().is(BStatusBoolean.TYPE)) ) {
highSlot++;
if ( ((BStatusBoolean) get(slots[i])).getValue() ) { //count only if it's 'true'
count = highSlot;
if (lowSlot <= 0) lowSlot = highSlot;
}
}
}
getHighestOut().setValue(count);
getLowestOut().setValue(lowSlot);
}