Category : Files from Magazines
Archive   : V12N02.ZIP
Filename : NEWOBJ.FRG

 
Output of file : NEWOBJ.FRG contained in archive : V12N02.ZIP

TYPE
CardValueType = RECORD
Suit : SuitType; { An enumeration of Clubs...Spades }
Spot : SpotType; { An enumeration of Ace..King }
END; { CardValueType }

CardType = object(TObject)
:
:
constructor Init(var CardValue : CardValueType);
:
:
end; { CardType }

CONSTRUCTOR DeckType.Init(NumDecks : Byte;
CardKind : Pointer;
CardCons : Pointer);
VAR
I, L : Word;
J : SpotType;
K : SuitType;
Card : CardValueType;
BEGIN
L := 0;
FOR I := 1 TO NumDecks DO
FOR K := Clubs TO Spades DO
FOR J := Ace TO King DO
BEGIN
Inc(L);
Card.Spot := J; { Setup the values to be passed }
Card.Suit := K; { to the constructor }
{ Create a new instance of the descendant card type }
Cards[L] := CardTypePtr(NewByType(CardKind,
CardCons,
Card));
END;
END;


{In a different unit, or the main program...}
MyDeck.Init(8,TypeOf(WindowCards),@WindowCards.Init);


  3 Responses to “Category : Files from Magazines
Archive   : V12N02.ZIP
Filename : NEWOBJ.FRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/