Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vartype() Got Me!
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Vartype() Got Me!
Divers
Thread ID:
00171368
Message ID:
00171368
Vues:
67
Vartype() is a new function to VFP6.

I have a calendar class that has several object: a text box for entering a date, a drop down button and the calendar ocx. In the text box ProgrammaticChange, I issue This.SetValues() method to set the individual calendar properties of Month, Day and Year. This works great if the class is dropped onto a form and the form is called with a DO FORM.

But, if I use the class on a form that itself is a saved class and is instanciated with a newobject("someform","someclass.vcx"). I get an error.

The code in the SetValues() method is:
with This.Parent.oleCalendar   && this line generates the error
	.Month = Month(This.Value)
	.Day   = Day(This.Value)
	.Year  = Year(this.Value)
endwith
This.Parent.Value = This.Value
The error is #1734, Property not found. Well, oleCalendar is an object that gives a "Could not be evaluated" message in the debugger. So I added the following code at the beginning of the SetValues() method:
if vartype(This.Parent.oleCalendar) <> "O"
   return
endif
Got the same error returned by the vartype() test. So I changed it to:
if type("This.Parent.oleCalendar") <> "O"
   return
endif
Now all is fine because the TYPE() function returns "U". Go figure. :)
Mark McCasland
Midlothian, TX USA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform