>&& since the variable implicitly declared in the FOR clause is PUBLIC >&& by default (don't ask me why .. design bug in my opinion) i'll always >&& declare counter variables to be local >&& if you'll always use the same name for counter variables like i do >&& you may get hit with bugs .. since a FOR loop somewhere down the stack >&& might change the wrong counter variable (i've learned this the hard way..) > >LOCAL lnFor, lcButton > >FOR lnFor = 1 TO NoOfButtonsFromSomeWhere > lcButton = 'BUT_' + ALLTRIM(STR(lnFor)) > IF PEMSTATUS(THISFORM,lcButton,5) && returns true if THISFORM.BUT_X exists > THISFORM.RemoveObject(lcButton) > ENDIF >ENDFOR >>