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
   |  
procedure InLn(X, Y, PoliceSize : integer; var Out : String);
                                        {A noter que les valeurs en X et
                                         Y employées sont à modifier selon
                                         la fonte.}
const Size = 8;                         {la taille de la police .CHR employée
                                         est importante car elle permet
                                         d'aligner le curseur sur le caractère
                                         actif. Par défaut un caractère BGI
                                         est une matrice de 8x8 pixels mais
                                         ça peut varier(TriplexFont,Smallfont
                                         etc...)}
 
var Nini  : string;
    Key   : char;
    i     : integer;
 
begin
     Setcolor(15);
     Nini:='';
     Moveto(X,Y);
     Outtext('Entrez le N initial : ');   {la phrase est un résidu}
     OuttextXY(X+180,Y,'_');
     i:=0;
     Setfillstyle(solidfill,0);
     Repeat
           Key:=readkey;
           If ((key<>#13) and (Key<>#27)) then
           begin
                Bar(X+180,Y-10,GetmaxX,Y+15);   {Note : cette ligne est a modifier
                                                 selon tes besoins évidemment}
                If (Key=#8) then
                begin
                     If (i>=1) then dec(i);
                     OuttextXY(X+180+(i*PoliceSize),Y,'_');
                     Nini:=Copy(Nini,1,length(Nini)-1);
                end
                else
                begin
                     inc(i);
                     OuttextXY(X+180+(i*PoliceSize),Y,'_');
                     Nini:=Nini+Key;
                end;
           end;
           OuttextXY(X+180,Y,Nini);
           If (key=#27) then Nini:='';
     Until ((key=#27) or (key=#13));
     Out:=Nini;
end; | 
Partager