Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object or NoObject?
Message
From
30/07/2013 11:11:27
 
 
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:
01579426
Views:
89
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform