Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Varype = 'O' after Init returns .F.
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00356876
Message ID:
00356982
Views:
19
>Hi All,
>
>Here's something I think is weird behaviour, can anyone explain this to me.
>Create a form in the form designer with a container on that. Put two textboxes in that container. In the init of Text2 put: Return .F. When this form is run: Vartype(THISFORM.Container1.Text2) will return "U" as expected.
>Now put an instance of the following class on the form. In my opinion it should result in the same, but it doesn't. Vartype(THISFORM.TestBox1.Text2) result in "O", Why???
>

It started to create an Object, so VARTYPE() became "O"; it did not instantiate so it's content became NULL. I'd bet that ISNULL(thisform.TextBox1.Text2) returned .T., too.

>
>DEFINE CLASS testbox AS container
> ADD OBJECT text1 AS TextBox WITH ;
> Value = "TestBox1", ;
> Top = 5, ;
> Name = "Text1"
>
> ADD OBJECT text2 AS noTextBox WITH ;
> Value = "Testbox2", ;
> Top = 30, ;
> Name = "Text2"
>ENDDEFINE
>
>DEFINE CLASS noTextBox AS TextBox
> PROCEDURE Init()
> return .f.
> ENDPROC
>ENDDEFINE
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform