Page 1 of 1

Blank Forms

Posted: Fri Aug 07, 2009 2:14 pm
by ConvertFromOldNGs
by David Mitchell >> Tue, 4 May 1999 3:00:38 GMT

Hi

I have tried creating an instance of the form class with:

vars
f : Form;begin

create f transient;
f.show;
end;

But this causes an exception. It says that I can't run the f.show method until I have created f, but I have created f. I thought that maybe Form was abstract, but when I looked, it said it was Real. Whats wrong?

Thanks

David.

PS I am using Jade 4.2.2

Re: Blank Forms

Posted: Fri Aug 07, 2009 2:14 pm
by ConvertFromOldNGs
by Dean Cooper >> Tue, 4 May 1999 4:01:08 GMT

Hi David,

The Form class cannot be abstract because Jade creates persistent instances of Form to store form definitions (all form definitions are instances of Form; they are not instances of your Form subclass). However you cannot create transient Form instances, as you've discovered. The Jade GUI engine ignores any attempts to create Form instances, which is why your f.show tells you f hasn't been created; as far as the GUI engine is concerned, it hasn't. I agree that the error in this case isn't too helpful. The ideal solution would be to have a couple more class options enabling you to define a class as "transient only" or "persistent only". We could then define Form as persistent only, and your attempt to create a transient Form would result in a more accurate error message. Perhaps in a future release... :-)

If you want a blank form, you'll have to define a Form subclass with nothing on it.

Dean.