by
Dean Cooper >> Fri, 9 Apr 1999 7:32:43 GMT
Hi David,
app.aboutForm is a reference to the persistent definition of your about form (an instance of Form), not the class of your about form. The app.aboutForm reference is of type Form, so:
create app.aboutForm transient;
is creating a transient instance of the Form class, which isn't what you want. Your next fragment:
var
f : Form;
begin
f := app.aboutForm;
create f transient;
is doing the same thing. The "create f transient" is assigning to f a reference to a transient instance of Form (because f is of type Form); the initial assignment to f of app.aboutForm is redundant.
This should do what you want:
vars
formClass : Class;
f : Form;begin
formClass := currentSchema.getClass(app.aboutForm.name);
create f as formClass transient;
f.show;
end;
We use the name of the form (obtained via app.aboutForm.name) to get the form's class. Once we have the class, we can use this to create the appropriate kind of form instance (referenced by f).
Hope this helps.
Dean.