SHARE
TWEET

Untitled

a guest May 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.    System.Generics.Collections,
  7.   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  8.   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20.   TPlayer = record
  21.       Name: string[10];
  22.       Score: Integer;
  23.   end;
  24.  
  25.   TPlayers = TList<TPlayer>;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.dfm}
  33.  
  34. procedure TForm1.Button1Click(Sender: TObject);
  35. var
  36.    Player: TPlayer;
  37.    Players: TPlayers;
  38. begin
  39.    Player.Name := 'Safffrrrrr';
  40.    Player.Score := 100;
  41.  
  42.    Players := TPlayers.Create;
  43.    Players.Add(Player);
  44.  
  45.  
  46.    MessageDlg(Players[0].Name + ' ' + IntToStr(Players[0].Score), mtInformation, [mbOk], 0);
  47. end;
  48.  
  49. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top