OOPLIB v0.01
HiSoft Basic Object Oriented Programming Library
c 1994, Data Uncertain Software - the authors of MODLIB.
Written by Craig Graham
Introduction
=============
OOPLIB provides support for dynamic class & object manipulation from HiSoft Basic2.
The facility is very limited at the moment, but will improve rapidly.
OOPLIB runs on any atari machine up to and including the Falcon, and has a very
minimal code overhead (<2Kbytes for the library code).
Currently, the features implemented are:
o Class declaration
- Attributes are specified in the class declaration
- Only long int (32bit) attributes are supported at the moment.
- Any number of attributes for a given class.
o Object instatiation
- Create an object of a class
o Object deletion
- Get rid of an object that you are finished with
o Attribute manipulation
- You can set the values of an object's attributes.
- You can read those values again.
o Services
- These are still under developement, so at the monoment there aren't any,
I have however, included the syntax that I intend to use for them here in
readiness.
If this seems a little limiting, take a look at some of the example code to see
the possible applications of OOPLIB as it stands.
Classes and objects are declared & created at run time, so a class could be
created 'on-the-fly' by an application (eg. a database program could create
a record class with attributes for each record, and the class could be defined
by the user whilst the program is running depending of what file is loaded).
INSTALLING OOPLIB
==================
You need all the library building stuff from the HiSoft Basic distribution
discs, put it all in a directory along with the file oop.bin, then:
buildlib.ttp gemvdi gemaes gemdos xbios bios menu oop
on a command line (I use mupfel from the gemini distribution).
This will create a new HBASIC.LIB file, which you can copy into your HiSoft
WORKING directory.....don't overwrite your original HiSoft disc's - that may be
a bad move :)
USING OOPLIB
==============
OOPLIB is used in the same way as the aes,vdi and xbios libraries, ie. you have
a LIBRARY statement at the start of your program. The name of the library is
OOP:
eg.
LIBRARY "OOP"
You must also include the OOPLIB header file OOPLIB.BH at the start of your
program in order to use services. This can be omitted if you are only using
the data grouping (attributes) and ignoring the service facilities.
CREATING CLASSES
==================
Classes are created using the following syntax:
class "","", ""
Where is a name for the class :)
and is a comma seperated list of attribute names for the class.
eg.
class "person","age,weight,height", ""
would declare a class called person, where each person has attributes age,weight
and height which may have values assigned to them.
CREATING OBJECTS
==================
You create an object (an instance of a class) using the following syntax:
p&=object&("")
The function object&() returns a pointer to an object of type .
eg.
craig&=object&("person")
would create an object of type person. The variable craig& would be a pointer to
the object.
DELETING OBJECTS
==================
An object can be disposed of when you don't need it anymore, returning the
storage it was using to the system. The syntax for this is:
delete_object