Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pcount()
Message
From
19/02/2003 12:20:31
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
19/02/2003 12:09:13
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00754996
Message ID:
00755022
Views:
12
I ran your code and got the following results.
cls1.mymethod  0
cls2.mymethod  0
cls1.mymethod  1
The last line is the problem. dodefault(tcParm) still should be 0 because o2.mymethod() did not pass a parameter.


>I don't see a problem here. Here is code that does what I think you are describing:
>
>
>o1 = crea('cls1')
>o2 = crea('cls2')
>o1.mymethod()
>o2.mymethod()
>return
>DEFINE CLASS cls1 as custom
>	procedure mymethod
>		lparameters tcParm
>		? Program(),pcount() && this = 0
>	endproc
>enddef
>
>DEFINE CLASS cls2 as cls1
>	procedure mymethod
>		lparameters tcParm
>		?Program(),pcount()
>		dodefault(tcParm)
>	endproc
>enddef
>
>
>I get this output in VFP8, and back to VFP5. It looks like design behavior to me. After all, you did pass parameter with the DoDefault() function.
>
>CLS1.MYMETHOD 0
>CLS2.MYMETHOD 0
>CLS1.MYMETHOD 1
>
>If you are referring to something different, please modify my code above and repost it to demonstrate.
>
>Thanks!
>
>>I am seeing different behavior with pcound(). If I call a method with a parameter directly all works well. If I subclass the method and put in a dodefault(), pcound() returns a 1 even though I don't pass a parameter. For example:
>>
>>
>>this.mymethod()
>>
>>* mymethod
>>lparameters tcParm
>>? pcount() && this = 0
>>
>>
>>this.mysubmethod()
>>
>>* mysubmethod
>>lparameters tcParm
>>dodefault(tcParm)
>>
>>* mymethod
>>lparameters tcParm
>>? pcount() && this = 1
>>
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform