[Gambas-user] About use of classes

Tomas Eroles i Forner tomas.eroles at ...277...
Sat Nov 3 12:28:24 CET 2007


Hi all
I'm developing an application and I have some doubts.
I've got a main form, frmMain, and a main class called Model.
In execution time, I need that this application uses, by now, only one
object of class Model with these conditions:
- If I have to open one saved file the program must fill the object by
reading the file (I think xml could be a good way).

- If I have to create a new model, I plan to do it using two ways: blank
model or using a Wizard. Once the model is created, several properties
could be changed with a dialog box called frmOpciones.

- When opening frmOpciones, it must read the properties of the active
model (if there's any open model) and show them for modify. Else,
properties are blank.

- When saving a model, the program has to add/change/delete information
on the file (probably I will do it creating a new file and changing the
name to the old file as a backup one).

Then, my problems are:
- I don't know where to put the sentence DIM MyModel as Model, that is,
I need that in execution time always work with the same model, then,
when opening frmOpciones, if I have a current project, does I have to
pass MyModel as parameter? If so, how I do it, that is, in which SUB in
frmOpciones does I have to write PUBLIC SUB OneSub(wMod as Model) ...
END?

- Another option could be create a Module (Start) as initial class that
can create a new Model object, and open the frmMain form, but, of
course, by passing a Model parameter, isn't it?

Thanks in advance for your help!!





More information about the User mailing list