1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Remplir: TButton;
Afficher: TButton;
procedure RemplirClick(Sender: TObject);
procedure AfficherClick(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
type mStructure = record
strQuestion : String ; //libelle de la q°
intCode : integer; //code permettant de vérifier la rép
tabStrReponses : array[1..10] of string; //tableau des réponses proposées
strNomPhoto : String; //photo associée à la q°
strCorrection : String; //correction de la q°
end;
var
Form1: TForm1;
mTabStrTableauGeneral: array[1..10] of mStructure;
implementation
{$R *.dfm}
procedure TForm1.RemplirClick(Sender: TObject);
var
i,indice:integer;
begin
for indice:=1 to 2 do
begin
mTabStrTableauGeneral[indice].strQuestion:='Question '+IntToStr(indice);
mTabStrTableauGeneral[indice].intCode:=indice;
for i:=1 to 5 do
mTabStrTableauGeneral[indice].tabStrReponses[i]:='Réponse '+IntToStr(i);
mTabStrTableauGeneral[indice].strNomPhoto:='NomPhoto '+IntToStr(indice);
mTabStrTableauGeneral[indice].strCorrection:='Correction '+IntToStr(indice);
end;
end;
procedure TForm1.AfficherClick(Sender: TObject);
var
i,indice:integer;
begin
for indice:=1 to 2 do
begin
ShowMessage(mTabStrTableauGeneral[indice].strQuestion);
ShowMessage(IntToStr(mTabStrTableauGeneral[indice].intCode));
for i:=1 to 5 do
ShowMessage(mTabStrTableauGeneral[indice].tabStrReponses[i]);
ShowMessage(mTabStrTableauGeneral[indice].strNomPhoto);
ShowMessage(mTabStrTableauGeneral[indice].strCorrection);
end;
end;
end. |
Partager