Should the following bit of code work? Code: {--input buttons--} for i := minInputVal to maxInputVal do once (GetLightingState(i)=ON) then begin if(GetLightingState(i+offsetVal)=OFF) then begin ProcessInput(i,i+offsetVal); end; end; Or is there a limitation preventing me from using the 'once' keyword from within a loop?