>I have this simplified code:
>
>WITH goToolBar
> .LockScreen = .T.
> IF TYPE('.cmdBoxing') = 'O'
> .RemoveObject('cmdBoxing')
> .LockScreen = .F.
> ENDIF
>ENDWITH
>
>That code is executed twice. First time it works fine, second it tries to remove the button again because TYPE('.cmdBoxing') = 'O' is still true. Reffering goToolBar.cmdBoxing.Name gives an error.
>What am I missing?
it is a bug.
if you remove a object, defined into the class, the reference property become null, but type still "O"
WITH goToolBar
.LockScreen = .T.
IF VARTYPE(.cmdBoxing) == 'O'
.RemoveObject('cmdBoxing')
ENDIF
.LockScreen = .F.
ENDWITH