Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check a object exist ?
Message
 
To
10/10/2004 23:57:35
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00950318
Message ID:
00950327
Views:
10
Yim,

> I want to check whether an object exist or not in the form.
> How to do that ? Use what command statement ?

You can use

pemstatus()
if  Pemstatus(ThisForm, "txtMyText", 5)
   DoMyStuff()
else
   ??chr(7)
   wait window "MyText is missing"
endif
aMembers()
lnMembers = aMembers(laX, Thisform, 2)
acti screen
for each lcObject in laX
   ? lcObject
endfor
The form's objects collection
acti screen
for each loObject in ThisForm.Objects
    ? loObject.Name
endfor
To see if an Object really IS an object (and not just a null-Value) You can
if vartype(thisForm.txtMyText) = "O" and ! isNull(thisForm.MyText)
   ? "Valid Object"
endif
HTH
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Previous
Reply
Map
View

Click here to load this message in the networking platform