Discussion:
Passing report listener between forms - VFP9
(too old to reply)
DeCiacco
2005-10-17 13:07:08 UTC
Permalink
I can't seem to figure out how to pass a report lister object to a form. The calling
form has the data needed for the report to run. I want to created the listener of
type 3, run my report to object and then pass it to my pop up form for display.

Thanks.
Dan Freeman
2005-10-17 15:47:33 UTC
Permalink
What have you tried so far? Did you get error messages?

Dan
Post by DeCiacco
I can't seem to figure out how to pass a report lister object to a
form. The calling form has the data needed for the report to run. I
want to created the listener of type 3, run my report to object and
then pass it to my pop up form for display.
Thanks.
DeCiacco
2005-10-18 15:23:45 UTC
Permalink
Thanks for your reply.

I've been able to figure it out. I simply did a Do Form <formname> WITH <objectname>
and the init event of my form accepts the object. I just got confused because
<objectname> is really a pointer to the object and that's the only thing that gets
passed instead of the actual object.
Post by Dan Freeman
What have you tried so far? Did you get error messages?
Dan
Post by DeCiacco
I can't seem to figure out how to pass a report lister object to a
form. The calling form has the data needed for the report to run. I
want to created the listener of type 3, run my report to object and
then pass it to my pop up form for display.
Thanks.
Bernhard Sander
2005-10-19 09:57:53 UTC
Permalink
Hi DeCiacco
Post by DeCiacco
I just got confused because
<objectname> is really a pointer to the object and that's the only thing that gets
passed instead of the actual object.
That's the way objects are passed in Foxpro, to variables, to properties, to
parameters. Only the pointer to the object is copied. But this pointer is enough
to access the object.
Also in a line like this:
loOtherObject = loSomeObject
only the pointer from loSomeObject is assigned to loOtherObject, never a copy of
the object! Both variables reference the same object. If you lateron change a
property of loSomeObject, you see the new value in loOtherObject.

Regards
Bernhard Sander
Mike Pratt
2005-10-19 14:28:52 UTC
Permalink
Do you store your object reference to a custom form property(good) in the
init or make your variable public(bad)?

When the init finishes all it's variables go out of scope.
Post by DeCiacco
Thanks for your reply.
I've been able to figure it out. I simply did a Do Form <formname> WITH <objectname>
and the init event of my form accepts the object. I just got confused because
<objectname> is really a pointer to the object and that's the only thing that gets
passed instead of the actual object.
Post by Dan Freeman
What have you tried so far? Did you get error messages?
Dan
Post by DeCiacco
I can't seem to figure out how to pass a report lister object to a
form. The calling form has the data needed for the report to run. I
want to created the listener of type 3, run my report to object and
then pass it to my pop up form for display.
Thanks.
DeCiacco
2005-10-19 16:07:57 UTC
Permalink
Custom form property....
But I don't do that anymore as I use the default datasession due to a problem i've
been having with the "Report Form <rptname> Object" command not allowing the
datasession to release if issued more than one time.

Check this newsgroup for "Form session not being released when nopageeject used -
VFP9", make sure to take a look at the updates as I discovered more info on the problem.

Thanks!
Post by Mike Pratt
Do you store your object reference to a custom form property(good) in the
init or make your variable public(bad)?
When the init finishes all it's variables go out of scope.
Post by DeCiacco
Thanks for your reply.
I've been able to figure it out. I simply did a Do Form <formname> WITH
<objectname>
Post by DeCiacco
and the init event of my form accepts the object. I just got confused
because
Post by DeCiacco
<objectname> is really a pointer to the object and that's the only thing
that gets
Post by DeCiacco
passed instead of the actual object.
Post by Dan Freeman
What have you tried so far? Did you get error messages?
Dan
Post by DeCiacco
I can't seem to figure out how to pass a report lister object to a
form. The calling form has the data needed for the report to run. I
want to created the listener of type 3, run my report to object and
then pass it to my pop up form for display.
Thanks.
Loading...