Search Locate Previous Next Contents

Adding a New Class

This assumes you have already added a new class library, called MyClass. To add a new class, simply copy the Template namespace in the normal way, run ParseSpec to make a default set of working variables, edit the specification to give it a suitable name and type, and run #.CPro.Build to make it known to Causeway. At this point you should see it in the designer (one of the list of new objects) with the sample property set.

 )cs #.MyClass                                                            
 'new' ŒNS ŒOR 'Template'  © Add a class called 'new'
 ParseSpec 'new'           © Define property tables
 #.CPro.Build              © Add it to the list of classes

You may like to save it on an external file as well as maintaining a workspace copy:

 SaveCls 'new'      © Save class definition on file new.cls

N.B. The Template class will run as a simple edit field – modify the Create, Refresh and Read functions as required. All the code assumes ŒML=1 and ŒIO=1, but Causeway will run with classes in any ŒIO,ŒML configuration.



Continue to: Removing a Class
© Copyright Causeway Graphical Systems Ltd 2001