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
|
procedure libelle();
var
i,j,k,m:integer;
nomtext,nomprovi,nom:string;
begin
// ouverture ou création du fichier texte
try
nomprovi:='';nom:='';
for i:=pos('.del',nomfich) downto 1 do
begin
if ord(nomfich[i])<>92 then nomprovi:=nomprovi+char(ord(nomfich[i]));
if ord(nomfich[i])=92 then Break;
end;
nom:=nomprovi;nomprovi:='';
for i:=length(nom) downto 2 do
begin
nomprovi:=nomprovi+char(ord(nom[i]));
end;
nomtext:=ExtractFilePath(Application.ExeName)+'dab00\'+ nomprovi +'mot.del';
AssignFile(fich_text,nomtext);Reset(fich_text);
except
AssignFile(fich_text,nomtext);ReWrite(fich_text);
enregindex.index_mot:=0;
Seek(fich_index,1);Write(fich_index,enregindex);
end;
Seek(fich_index,1);Read(fich_index,enregindex);
i:=enregindex.index_mot;
if i>0 then
begin
compte.aide_saisie.Clear;
compte.aide_saisie.Left:=84;
compte.aide_saisie.Top:=122;
compte.aide_saisie.Visible:=true;
for j:=1 to length(compte.Edit1.Text) do
begin
for k:=1 to enregindex.index_mot do
begin
Seek(fich_text,k); Read(fich_text,enregtext);
for m:=1 to length(enregtext.mot) do
begin
if enregtext.mot[m]=trim(compte.Edit1.Text) then
compte.aide_saisie.Items.Add(enregtext.mot);
end;
end;
end;
end; // fin de if i>0
end; |
Partager