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
|
uses newdelay, crt, graph;
var GraphDrv,GraphMd : integer;
const Path : string = 'c:\tp\bgi';
function InLn(X, Y : integer) : String; {A noter que les valeurs en X et
Y employées sont à modifier selon
la fonte.}
const PoliceSize = 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}
inc(i);
Nini:=Nini+Key;
OuttextXY(X+180,Y,Nini);
OuttextXY(X+180+(i*PoliceSize),Y,'_');
end;
If (key=#27) then Nini:='';
Until ((key=#27) or (key=#13));
InLn:=Nini;
end;
begin
Initgraph(GraphDrv,GraphMd,Path);
Cleardevice;
InLn(5,5);
end. |
Partager