Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1487 connectés 

  FORUM HardWare.fr
  Programmation
  Delphi/Pascal

  Comment ajouter un élément à un fichier typé

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Comment ajouter un élément à un fichier typé

n°1368095
endemyon
Posté le 16-05-2006 à 18:21:37  profilanswer
 

Comment ajouter un élément à l fin un fichier typé sans le lire avant.
Merci d'avance


---------------
Mes photos : http://500px.com/endemyon
mood
Publicité
Posté le 16-05-2006 à 18:21:37  profilanswer
 

n°1368168
endemyon
Posté le 16-05-2006 à 19:40:24  profilanswer
 

J'ai trouve
Var
F:file of TRatingPoint;
ActualRating:TRatingPoint;
 
begin
  actualrating.time:=now;
  actualrating.rating:=OwnInfo.rating;
  assignfile(F,Applicationpath+Owninfo.Name+'.rat');
  if fileexists(Applicationpath+Owninfo.Name+'.rat') then reset(f)
    else rewrite(f);
  seek(f,filesize(f));  
  write(f,actualrating);
  closefile(f);
end;


---------------
Mes photos : http://500px.com/endemyon
n°1370915
el zozo
Stroumf Grognon
Posté le 19-05-2006 à 22:23:32  profilanswer
 

De tete (pas de compilateur sous la main) je dirait mème :

endemyon a écrit :

Var
F:file of TRatingPoint;
ActualRating:TRatingPoint;
 
begin
  actualrating.time:=now;
  actualrating.rating:=OwnInfo.rating;
  assignfile(F,Applicationpath+Owninfo.Name+'.rat');
  if fileexists(Applicationpath+Owninfo.Name+'.rat') then append(f)
    else rewrite(f);
  seek(f,filesize(f));
  write(f,actualrating);
  closefile(f);
end;


 
Append ouvre le fichier en ajout (je ne sait plus si il authorise à utiliser "seek" par la suite)

Message cité 1 fois
Message édité par el zozo le 19-05-2006 à 22:25:02
n°1371136
aldo13000
Posté le 20-05-2006 à 15:43:53  profilanswer
 

el zozo a écrit :

De tete (pas de compilateur sous la main) je dirait mème :
 
 
Append ouvre le fichier en ajout (je ne sait plus si il authorise à utiliser "seek" par la suite)


 
 
Oui mais append  , c'est pour les fichiers de  texte .


---------------


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Delphi/Pascal

  Comment ajouter un élément à un fichier typé

 

Sujets relatifs
Copier les données d'un fichier vers un autre fichierComment imprimer un fichier Excel sous VB ?
pb lecture fichier audio avec matlabcommande vb créant un racoucis à un emplacement qui ramène au fichier
Lire un fichier excel en phpComment ajouter des lignes dans une table grace a un datagrid ?
exécuter une requête sql sur un fichier excel[JExcelAPI] Modifier un fichier excel
fichier css à la racine[Résolu]Lecture de fichier qui lit que le premier caractère
Plus de sujets relatifs à : Comment ajouter un élément à un fichier typé


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR