Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object or NoObject?
Message
From
30/07/2013 11:07:49
 
 
To
30/07/2013 10:54:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01579421
Message ID:
01579425
Views:
52
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform