Chipmunk Basic v3.3 Object Oriented programming syntax additions. 96-Feb-25 --- MS QuickBasic and VisualBasic already have this struct syntax: TYPE foo ' declare a type x AS integer ' member data ' ... END TYPE DIM a AS foo ' create an object foo.x = 7 ' change data inside object PRINT foo.x ' access the data member --- To make types into objects, they need encapsulation (private data), member functions/subroutines (methods), and inheritance. The additions to the syntax, then, look like this: CLASS foo ' declare a type x AS integer ' public member data ' ... END CLASS CLASS bar AS foo ' bar is a child subclass of foo ' and inherits all it's data types y AS integer z AS PRIVATE double ' private data s AS PUBLIC string ' the public keywork is optional ' ... PRIVATE SUB hiddenblah (...) ' private member subroutines ' ... z = 0 ' access private data END SUB SUB blah (...) ' define a public member function this.hiddenblah(...) ' call a private subroutine END SUB (v) ' optional return value END CLASS DIM b AS NEW bar ' this is a change from v3.3.6 PRINT b.x, b.y ' access the (superclass & subclass) data CALL b.blah(...) ' call method subroutine y = b.blah(...) ' call method as a function Since a Chipmunk Basic program is just a flat file, there is no seperation of interface definition and implementation sections. --- Overriding member functions: class foo x as integer z as private double public sub bar(nn) this.z = ... end sub end class class mumble as foo y as public integer public sub bar(nn) ' over-ride the superclass method ... foo.bar(nn) ' scope resolution to allow wrapping end sub (...) end class --- Standard disclaimers apply. This is pre-beta level stuff. - rhn Copyright (c) 1996 Ronald H. Nicholson, Jr. ---