Cy
Fri Dec 03 17:14:15 CST 2004
Mike McDowall wrote:
> On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
> <irs.znospamforme@skynet.be> wrote:
>
>
>>Hi,
>>
>>I got this error on the last line ?!
>>anybody an idea.
>>
>>procedure selectme
>>Lparameters loselectme
>>If TYPE("loselectme") <> "O" .or. isnull(loselectme)
>>Return .F.
>>Endif
>>lSelectLongName = loselectme.Parent.Name + loselectme.Name
>>...
>>
>>I can say a lot about this on how it works
>>and at the same moment I don't have any clue !
>>This seems to bug a Vfp bug ?!
>>Because the code is quite clear I think.
>>
>>So anyway I will try to explain the whole picture.
>>This procedure is from a "multiselectme"class I created.
>>I place this class on a form and call it when I want
>>to visually highlight an object.
>>(I visually highlight one or more objects by adding on each corner
>>a highlighter =small rectangular shape in a bright color)
>>
>>the procedure is called something like this :
>>procedure myobject.rightclick
>>thisform.multiselect.selectme(this)
>>*dosomethingelse
>>thisform.multiselect.deselectme(this)
>>
>>I only get this error when the user
>>Rclicks on the object when the form is not active !
>>So when the user first clicks on the form to activate it and then
>>Rclick on the object I don't get an error.
>>But of course I can't teach my user to do it this way.
>>
>>So I tried to activate the form in the Rclick prior to
>>thisform.mulitselect.selectme
>>but whether I use This or Thisform I get the same error.
>>
>>So has anybody an idea ?
>
> Hi Christophe,
> Apologies for the slow response.
>
> I have had this error more than once, and it is _always_ my code :-)
> The message has always told the truth. The key to your problem is that
> the form is not active. Something else is the active object when you
> Rclick, and it's Parent is not an object. You need to trace that.
>
> Trying to activate the form after the Rclick has fired is too late.
> The Parent of the object will not change. You would need to know what
> the user wanted to Rclick (impossible) and fire the Rclick for that
> control.
>
> I find the debugger is a pig. Difficult to use, slow, and often
> distorts processing so that it returns different results from a
> program. I have used it quite a lot, but it has become a tool of last
> resort. My main method now is to use breakpoint I insert in my code. A
> command line fires a utility which Lists Memo, Stat and the procedure
> hierarchy to0 a text file, then displays a wait window with procedure
> name and lineno(). A Y keyed then triggers Suspend so I can pull
> things together in more detail - particularly testing conditions.
>
> I suggest you try putting a suspend into your called procedure before
> the line that gives theerror, then test what this.name returns.
I would think that you would want to chech to see if object.parent was
of type object AND that that the property your trying to work with is of
the proper type as well.
--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com