Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object is skipping sub-code
Message
From
04/07/2003 17:38:13
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00806776
Message ID:
00807100
Views:
21
Hi Sergey,
Yeah I discovered that my vcx file had 2 classes with the same name somehow. My app wasn't using the one I was editing. Project only showed 1, but the class browser showed 2. Deleted one and everything was fine.

>Hi Bill,
>
>I don't see this in the small test I put toghether. The Assign of the subclass fires as it should be.
CLEAR
>PUBLIC oObj
>oObj = NEWOBJECT("mySubClass")
>oObj.myProperty = "Test"
>RETURN
>
>DEFINE CLASS myClass as Custom
>myProperty = ""
>
>PROCEDURE myProperty_Assign()
>	LPARAMETERS vNewVal
>	this.myProperty = vNewVal
>	? TIME(), 'Close ' + this.myProperty
>ENDPROC
>ENDDEFINE
>
>DEFINE CLASS mySubClass as myClass
>PROCEDURE myProperty_Assign()
>	LPARAMETERS vNewVal
>	DODEFAULT(vNewVal)
>	? TIME(), 'Open ' + this.myProperty
>ENDPROC
>ENDDEFINE
>
>
>>Nevermind, somehow my vcx file got 2 classes with the same name in it. And obviously my code was running the one I wasn't editing.
>>
>>I created a property along with the assign() method.
>>
>>I put code into the assign() method changing the caption on another control in the class.
>>
>>I created a sub-class and put code into the assign() changing the caption on another control added in the sub-class. The code in the sub-class never executes.
>>
>>define mySubClass as myClass
>>enddefine
>>
>>myClass.myProperty_Assign()
>>  lparameters vNewVal
>>  this.myProperty = vNewVal
>>  this.myControl_1.caption = 'Close ' + this.myProperty
>>
>>mySubClass.myProperty_Assign()
>>  lparameters vNewVal
>>  dodefault(vNewVal)
>>  this.myControl_2 = 'Open ' + this.myProperty
>>
>>
>>When I trace through it, as soon as I assign a value to myProperty, it immediately jumps to myClass.myProperty_Assign(), it skips over mySubClass.myProperty_Assign()
>>I've tried putting nodefault in the code, didn't help.
>>
>>TIA
Bill Morris
Previous
Reply
Map
View

Click here to load this message in the networking platform