Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object or NoObject?
Message
From
30/07/2013 11:58:16
 
 
To
30/07/2013 11:11:27
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:
01579437
Views:
47
>>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
>
>
Hi,
TYPE( "loObj.Class" ) # "C"
seems to work!

FWIW: TYPE( "loObj.Class" )= "U"

and errorhandler gives indeed: OLE error code 0x80020006: Onbekende naam. (unknown name)

Thanks,

Regards,

Koen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform