Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object or NoObject?
Message
De
30/07/2013 11:07:49
 
 
À
30/07/2013 10:54:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01579421
Message ID:
01579425
Vues:
51
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform