Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: Java  |  size: 0.67 KB  |  hits: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public void onExecute() throws Exception
  2. {
  3.   int count = 0 ;
  4.   int highSlot = 0 ;
  5.   int lowSlot = 0 ;
  6.  
  7.   Property[] slots = getProgram().getPropertiesArray(); // get slots into an array
  8.  
  9.   for(int i=0; i < slots.length; i++) {
  10.    
  11.       if ( (slots[i].getName().startsWith("bIn")) && (slots[i].getType().is(BStatusBoolean.TYPE)) ) {
  12.      
  13.         highSlot++;    
  14.        
  15.         if ( ((BStatusBoolean) get(slots[i])).getValue() ) { //count only if it's 'true'
  16.  
  17.           count = highSlot;
  18.           if (lowSlot <= 0) lowSlot = highSlot;
  19.        
  20.         }
  21.       }
  22.   }
  23.      
  24.      
  25.   getHighestOut().setValue(count);
  26.   getLowestOut().setValue(lowSlot);
  27. }