[Gambas-user] Procedure new()

Benoît Minisini gambas at ...1...
Wed Jul 29 13:29:32 CEST 2009


> craf ha scritto:
> > Hi.
> >
> > What are the roles in the general procedure new ()?
> > What difference has the procedure Form_Open ()
>
> If I correctly understand your question, the reply is the following.
> new() is a generic language construct which creates new objects
> (instances of a class). Several gambas objects like Lists, Controls,
> Forms and so on are put to life with new(), more or less explicitly.

Actually all Gambas objects are created by New. Sometimes you don't see it.

> Form_Open is an event; when you (or Gambas on your behalf) display a
> form for the first time, this procedure is called to let you do your
> stuff in that precise moment. It is common to put several new()'s in
> this procedure, to prepare data the form will use, but those statements
> could be put instead elsewhere: it depends on the logic of the program.
> This is the only relationship between new() and Form_Open().
>
> I hope this is the right reply to your question.
>
> Regards,
> Doriano
>

Or maybe he was talking about "_new()", the constructor?

-- 
Benoît




More information about the User mailing list