Home All Groups Group Topic Archive Search About

Parse and preserve an object in a class

Author
1 Jun 2005 4:45 AM
Tony
Hi,

    I am deliberately avoiding using an Modules in my app. Instead, I am
using Classes. Is there a way to save a <form>.<object> to a Class from one
Form so that the result can be used in another?

    For example, I have a MaskEdit for Date input. When the user selects a
command button, the Calendar appears. The user selects the date he/she
wants. The calendar disappears and the resulting date is displayed in the
MaskEdit control. I need to hold the Form name and MaskEdit so that the
Calendar double click transfers the correct date to it.

    Thank you.

Tony

Author
1 Jun 2005 11:18 AM
Steven Burn
No ......... now don't be lazy <g>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Show quoteHide quote
"Tony" <speedil***@hotmail.com> wrote in message news:efIXITmZFHA.3364@TK2MSFTNGP09.phx.gbl...
> Hi,
>
>     I am deliberately avoiding using an Modules in my app. Instead, I am
> using Classes. Is there a way to save a <form>.<object> to a Class from one
> Form so that the result can be used in another?
>
>     For example, I have a MaskEdit for Date input. When the user selects a
> command button, the Calendar appears. The user selects the date he/she
> wants. The calendar disappears and the resulting date is displayed in the
> MaskEdit control. I need to hold the Form name and MaskEdit so that the
> Calendar double click transfers the correct date to it.
>
>     Thank you.
>
> Tony
>
>
Author
1 Jun 2005 3:54 PM
Larry Serflaten
"Tony" <speedil***@hotmail.com> wrote

>     I am deliberately avoiding using an Modules in my app. Instead, I am
> using Classes.

And if you deliberately type using only one finger, then it will take you a lot
longer to get done.  That's just great if you get paid by the hour, but if you
want to get the job done, then you might want to re-think your plans....

<g>
LFS
Author
2 Jun 2005 8:41 AM
J French
On Wed, 1 Jun 2005 10:54:10 -0500, "Larry Serflaten"
<serfla***@usinternet.com> wrote:

>
>"Tony" <speedil***@hotmail.com> wrote
>
>>     I am deliberately avoiding using an Modules in my app. Instead, I am
>> using Classes.
>
>And if you deliberately type using only one finger, then it will take you a lot
>longer to get done.  That's just great if you get paid by the hour, but if you
>want to get the job done, then you might want to re-think your plans....

Actually Larry, using Classes can save quite a lot of time in the long
run

In this case I do not quite understand what the OP wants to do, but my
hunch is that he should be using RaiseEvent to return the date.
Author
2 Jun 2005 12:42 PM
Larry Serflaten
"J French" <erew***@nowhere.uk> wrote in

> >>     I am deliberately avoiding using an Modules in my app. Instead, I am
> >> using Classes.
> >
<...>
>
> Actually Larry, using Classes can save quite a lot of time in the long
> run

I'd be one of the first to look to classes, but....

They don't hold all the answers.  When you need a global variable then
there really is no reason to try to solve the problem with classes.  Even
if you create a class of global variables, where would you declare it
to have application wide scope?


> In this case I do not quite understand what the OP wants to do, but my
> hunch is that he should be using RaiseEvent to return the date.

I didn't look to close at the specifics either, since he stated a generic
version in the first couple lines.  But, looking back it look like he wants
to turn his calender form into a UserInput form such that it will return
the selected date.  For that I'd call a function on the calander form
that returns the date:

  Text1.Text = UserDate.GetDate()

That way the calander form doesn't need to know who's calling it, or
how to expose the date after its been selected.  It returns the date from
a function that shows the form and gets the desired input.  The
caller is blocked until the user dismisses the form....

LFS
Author
2 Jun 2005 1:12 PM
J French
On Thu, 2 Jun 2005 07:42:29 -0500, "Larry Serflaten"
<serfla***@usinternet.com> wrote:

Show quoteHide quote
>
>"J French" <erew***@nowhere.uk> wrote in
>
>> >>     I am deliberately avoiding using an Modules in my app. Instead, I am
>> >> using Classes.
>> >
><...>
>>
>> Actually Larry, using Classes can save quite a lot of time in the long
>> run

>I'd be one of the first to look to classes, but....

>They don't hold all the answers.  When you need a global variable then
>there really is no reason to try to solve the problem with classes.  Even
>if you create a class of global variables, where would you declare it
>to have application wide scope?

Well, generally in MainMod.bas
- it would start life off as a UDT

Show quoteHide quote
>> In this case I do not quite understand what the OP wants to do, but my
>> hunch is that he should be using RaiseEvent to return the date.

>I didn't look to close at the specifics either, since he stated a generic
>version in the first couple lines.  But, looking back it look like he wants
>to turn his calender form into a UserInput form such that it will return
>the selected date.  For that I'd call a function on the calander form
>that returns the date:

>  Text1.Text = UserDate.GetDate()

>That way the calander form doesn't need to know who's calling it, or
>how to expose the date after its been selected.  It returns the date from
>a function that shows the form and gets the desired input.  The
>caller is blocked until the user dismisses the form....

I agree, but I suspect that he has somehow created the calendar
control on the fly (perhaps some sort of Dialog)

The real thing I like about shoving stuff into Classes is that they
(their contents) are not visible unless one decides to let them be
visible.

Using RaiseEvent to update a number of 'parents' is also blissful

'Parents should know very little about their children, and children
should know /nothing/ about their parents'.

Heh - he'll have problems distributing the Calendar Control ...