Guest_imported
New member
- Jan 1, 1970
- 0
I have the following:
Type
TCards = Record
Suit : ShortInt; // 1
iamonds 2:Hearts 3:Clubs 4:Spades
Status : ShortInt; // 1:Solved 2:Table 3:Hand
PlacementNo : ShortInt; // 52 placements
Back : Boolean; // Frontside or Backside of card
Name : String[30]; // Eg.: Ace of Diamonds
Filename : String[20]; // Filename for the Bitmap
Picture : TPicture; // Picture for Image
Image : TImage; // Image for the card
End;
And the following Variable:
Var
Cards : Array[1..52] of TCards;
I am then assigning values to each of the Cards:
For I := 1 to 13 Do // Diamonds
Begin
Cards.Suit := 1;
Cards.Status := 3;
Cards.PlacementNo := I;
Cards.Back := False;
Cards.Name := 'Diamonds ' + IntToStr(I);
Cards.Filename := 'D' + IntToStr(I) + '.bmp';
Cards.Picture.LoadFromFile(Cards.Filename);
Cards.Image.Picture := Cards.Picture;
End;
My question is: "How do I create the cards at Runtime".
This keeps getting me Exception Errors.
Thanks in advance
EskimoJan
Type
TCards = Record
Suit : ShortInt; // 1
Status : ShortInt; // 1:Solved 2:Table 3:Hand
PlacementNo : ShortInt; // 52 placements
Back : Boolean; // Frontside or Backside of card
Name : String[30]; // Eg.: Ace of Diamonds
Filename : String[20]; // Filename for the Bitmap
Picture : TPicture; // Picture for Image
Image : TImage; // Image for the card
End;
And the following Variable:
Var
Cards : Array[1..52] of TCards;
I am then assigning values to each of the Cards:
For I := 1 to 13 Do // Diamonds
Begin
Cards.Suit := 1;
Cards.Status := 3;
Cards.PlacementNo := I;
Cards.Back := False;
Cards.Name := 'Diamonds ' + IntToStr(I);
Cards.Filename := 'D' + IntToStr(I) + '.bmp';
Cards.Picture.LoadFromFile(Cards.Filename);
Cards.Image.Picture := Cards.Picture;
End;
My question is: "How do I create the cards at Runtime".
This keeps getting me Exception Errors.
Thanks in advance
EskimoJan