| 12
 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
 
 | program Set5;
 
{$FRAME_WIDTH 320}
{$FRAME_HEIGHT 200}
 
const
  LARGEUR = 320;
  HAUTEUR = 200;
 
type
  Number = Double;
 
  MovieClip = external class
  end;
 
  TextField = external class
    constructor Create(Parent: MovieClip; Name: string; Depth, Left, Top, Width, Height: Number) as Parent.createTextField;
    property text: string;
  end;
 
var
  textField1: TextField;
  sortie: string;
 
type
  tJour = (dimanche = 1, lundi, mardi, mercredi, jeudi, vendredi, samedi);
 
const
  ChaineJour: array[1..7]of string = ('dimanche', 'lundi', 'mardi', 'mercredi',
  'jeudi', 'vendredi', 'samedi');
 
var
  s: set of tJour;
  j: tJour;
 
begin
////////////////////////////////////////////////////////////////////////////////
  textField1 := TextField.Create(nil, 'textField1', 0, 0, 0, LARGEUR, HAUTEUR);
////////////////////////////////////////////////////////////////////////////////
 
  s := [dimanche, lundi];
 
  s := s + [mercredi];
 
  sortie := '';
  for j := dimanche to samedi do
    if j in s then
      begin
        sortie := sortie + ChaineJour[Ord(j)];
        sortie := sortie + Chr(13);
      end;
 
{ Résultat :
  dimanche
  lundi
  mercredi }
 
////////////////////////////////////////////////////////////////////////////////
  textField1.text := sortie;
////////////////////////////////////////////////////////////////////////////////
end. | 
Partager