Introduction to OOP: Chapter 3: Classes and Methods: [next] [previous] [audio] [real] [text]

Delphi Pascal is a Slightly Different Language

unit card;

interface

type 
	suits = (Heart, Club, Diamond, Spade);

	colors = (Red, Black);

	TCard = class (TObject)
		public
				(* creation *)
			constructor Create (c : integer; s : suits);

				(* manipulation *)
			function 	color	: colors;
			procedure	draw (win : TWindow; x, y: integer);
			function 	faceUp	: boolean;
			procedure	flip;
			function 	rank	: integer;
			function 	suit	: suits;

		private
			suitValue : suits;
			rankValue : integer;
			faceUp : boolean;
		end;

implementation
	...
end.

Borland's Delphi Pascal language is slightly different.

Intro OOP, Chapter 3, Slide 19