Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object or NoObject?
Message
 
 
À
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:
01579426
Vues:
88
This message has been marked as the solution to the initial question of the thread.
>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

It seems that the object it returns is an OLE object which does not expose the "Class" property.
Can you see in the debugger if you just type m.loObj what this object is (or m.loObj.Name)?

You might want to try:
DO case
        case myCondition
Otherwise

loObj    = Sys( 1270 )
        
        If TYPE( "m.loObj.Class" ) # "C"
            Return
        Endif
        
        TRY
                lcClass  = m.loObj.Class
        CATCH TO loError
                Messagebox(loError.Message)
                lcClass = NULL
        ENDTRY

endcase
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform