[Gambas-user] life of an object

Hugo htakada at ...626...
Fri Dec 2 19:29:49 CET 2005


Thanks Benoit, I declared one static public variable in the form as you
suggested but I'm still having the same problem, did I misunderstand you ?
what am I doing wrong ?

thanks again

Hugo

On 01/12/05, Benoit Minisini <gambas at ...1...> wrote:
>
> On Wednesday 30 November 2005 22:44, Hugo wrote:
> > Hi,
> > when a form is closed , can I still get some atributes of it , or is it
> > garbage collected right after one closes it, trouble is I need to get
> some
> > data from a form I show to the user.
> > I do something like this:
> > sub getAnswerFromUser()
> >   Dim frm as SomeForm
> >   dim st as string
> >   frm = NEW SomeForm
> >   frm.title = 'Some Title'
> >   frm.show()
> >   st = frm.someAtt    'at this point a get Invalid Object runtime error
> >   return st 'this should be the answer
> > end
> > is this code correct ?
> >
> > thanks for any help
> > Hugo
>
> This code is correct, but a form becomes invalid as soon as it is deleted.
>
> frm.Show() should show the form modeless, except if a modal window is
> already
> displayed. Then it is shown modal. So it may be destroyed when frm.Show()
> terminates.
>
> If you want to have public variables in the form to return some
> information,
> make them static. Static variables don't need any object to be valid.
>
> Regards,
>
> --
> Benoit Minisini
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20051202/39efcab5/attachment.html>


More information about the User mailing list