Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class - width - cursor/relation
Message
From
03/11/2006 06:44:00
 
 
To
03/11/2006 06:26:04
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01166838
Message ID:
01166854
Views:
17
Switch to VFP9 now, and enjoy the EMPTY class!

>Interesting to know ....
>
>I have a LightWeight base class. One I use to make invisible classes (Queue, stack, etc)
>
>I had it based on a relation. I have an Image class >> Heigth/Width
>
>A few days ago, I found in FoxWiki that the cursor class destroys faster. So I decided to base the LightWeight on a cursor class
>
>Until I found out that the cursor gives an error
>
>So, I'll base it on a custom class - that is one error I won't have when I switch to vfp9
>
>Thanks,
>_______________________
>
>>They both geives me error in VFP9
>>
>>>>What do you expect to happen? Neither width nor height are available properties for these classes!
>>>
>>>I knew I would get an answer like this.
>>>
>>>They may not be 'available', but they can be defined
>>>
>>>The thing is, why does it work with a relation and gives an error on a cursor class ?
>>>________________
>>>>>Something funny I've come across
>>>>>
>>>>>If you have a class based on cursor, avoid the Width property (Height as well)
>>>>>
>>>>>
>>>>>xxx = createobject('test1', 20)
>>>>>xxx = createobject('test2', 20)
>>>>>
>>>>>define class test1 as cursor
>>>>>
>>>>>	width = 0
>>>>>function init( Width )
>>>>>	
>>>>>	this.Width = min(m.width, this.Width) && error here
>>>>>	?this.Class, this.Width
>>>>>	
>>>>>endfunc
>>>>>enddefine
>>>>>
>>>>>define class test2 as relation
>>>>>
>>>>>	width = 0
>>>>>function init( Width )
>>>>>	
>>>>>	this.Width = min(m.width, this.Width)	&& no error here
>>>>>	?this.Class, this.Width
>>>>>endfunc
>>>>>enddefine
>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform