Blank Forms

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Blank Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:14 pm

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

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Blank Forms

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:14 pm

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.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 1 guest