home *** CD-ROM | disk | FTP | other *** search
- program Listing5_1;
-
- type
-
- Elf = object
- Name : string;
- constructor Init( Monicker : string );
- procedure ShopScript;
- procedure GoShopping;
- end;
-
- constructor Elf.Init( Monicker : string );
- begin
- Name := Monicker;
- end;
-
- procedure Elf.ShopScript;
- begin
- writeln( '<Door slams as ', Name, ' leaves>');
- writeln( '<long pause.......>' );
- writeln( '<Door slams as ', Name, ' returns>');
- writeln( Name, ': I went to the store and bought milk and eggs.');
- end;
-
- procedure Elf.GoShopping;
- begin
- ShopScript;
- end;
-
-
- var
- Jay : Elf;
-
- begin
- Jay.Init( 'JAY' );
-
- Jay.GoShopping;
- end.
-
- { Listing 5-1 }