>Hi,
>I have following coding:
>
>DO case
>case myCondition
>Otherwise
>
>loObj = Sys( 1270 )
>
> If Vartype( m.loObj ) # "O"
> Return
> Endif
>
> lcClass = m.loObj.Class
>endcase
>
>Which errors on line lcClass = m.loOj.CLass with error 1426
>In Debugger vartype(m.loObje) = "O"
>Any idea what kind of mistake in this coding?
>Regards,
>Koen
I have seen this happen on objects that were part of the definition (form or class), but were later deleted. Those types are "ghost objects" which remain and show up in the debugger and on some instructions, but not all, and are not really present and cause this kind of error. I have never found a workaround for it, except to not include those objects at design time, but rather instantiate them manually from another class or one-by-one at runtime. Then when they are deleted, they go away.
If it's not the result of an object being deleted, I don't know. It may be something similar / related.
You can surround your block with a TRY..CATCH..ENDTRY to see if it really is an object you can access it to avoid the error.