Some lovely object code to get us started
First, set up the class. This is nothing but a blueprint. We add two variables (attributes) and three procedures (methods)
type Next. Create the object variable. This doesn't actually create the object, which is fun :-(
var Now set up the procedures (methods) that we've announced in our class definition
procedure myclass.output(); We are ready to write the code. There's one absolutely vital thing to do first. Actually create the object.
begin OK, we've done the housekeeping. Now we can write to the attributes and call the methods. Let's see what happens
myobject.name := 'Harold'; |