Probleme de fichier

Résolu
guigui265 Messages postés 113 Date d'inscription mercredi 29 novembre 2000 Statut Membre Dernière intervention 16 avril 2006 - 31 janv. 2006 à 15:23
guigui265 Messages postés 113 Date d'inscription mercredi 29 novembre 2000 Statut Membre Dernière intervention 16 avril 2006 - 31 janv. 2006 à 16:06
bjr
j'ai créé un typebiblio puis de ce type, un fichier f biblio:
fbiblio:file of biblio
mais lors de la compilation message d'erreur:
[erreur]unit_principale.pas(55):le type 'biblio' nécessite une finalisation-non aurotisé dans type fichier
pourquoi cette erreur? comment la résoudre?
merci
guigui

4 réponses

Cirec Messages postés 3833 Date d'inscription vendredi 23 juillet 2004 Statut Modérateur Dernière intervention 18 septembre 2022 50
31 janv. 2006 à 15:54
il faut préciser une longueur pour toutes les variables de type String

type


biblio=record
code:string[4];
titre:string[30];
nom:string[30];
prenom:string[30];
date_sortie:string[10];
date_retour:string[10];
rendu:string[255];
end;

@+
Cirec
3
Cirec Messages postés 3833 Date d'inscription vendredi 23 juillet 2004 Statut Modérateur Dernière intervention 18 septembre 2022 50
31 janv. 2006 à 15:34
Salut,
donne un peut plus de précision sur les déclarations que tu as faites.
Voici un exemple de déclaration qui fonctionne.

Ex :
Type


Planings = Record
Semaine:String[2];
Heures :Array[1..12,1..2] of String[5];
End;


Fichier =File of Planings;
Var
F : Fichier; // accès au fichier
Detail : Planings; // accès au contenu

@+
Cirec
0
guigui265 Messages postés 113 Date d'inscription mercredi 29 novembre 2000 Statut Membre Dernière intervention 16 avril 2006
31 janv. 2006 à 15:42
voila le detail,c un peu long, mais bon ...

unit Unit_principale;





interface


uses


Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,


Dialogs, StdCtrls, ComCtrls;


type


biblio=record


code:string[4];


titre:string[30];


nom:string[30];


prenom:string[30];


date_sortie:string;


date_retour:string;


rendu:string;


end;


Tfrm_principal = class(TForm)


lbl_num: TLabel;


lbl_titre: TLabel;


lbl_nom: TLabel;


lbl_prenom: TLabel;


lbl_date1: TLabel;


lbl_date2: TLabel;


lbl_retour: TLabel;


ListBox: TListBox;


zs_num: TEdit;


zs_titre: TEdit;


zs_nom: TEdit;


zs_prenom: TEdit;


zs_date_sortie: TDateTimePicker;


zs_date_retour: TDateTimePicker;


bt_ajouter: TButton;


bt_lister: TButton;


bt_modifier: TButton;


bt_suppr: TButton;


bt_liste2: TButton;


bt_quitter: TButton;


zs_retour: TCheckBox;


procedure bt_quitterClick(Sender: TObject);


procedure FormCreate(Sender: TObject);


procedure FormClose(Sender: TObject; var Action: TCloseAction);


procedure bt_ajouterClick(Sender: TObject);


private


{ Déclarations privées }


public


{ Déclarations publiques }


end;


var


frm_principal: Tfrm_principal;


fbiblio:file of biblio;


xbiblio:biblio;


numero:integer;


implementation
0
guigui265 Messages postés 113 Date d'inscription mercredi 29 novembre 2000 Statut Membre Dernière intervention 16 avril 2006
31 janv. 2006 à 16:06
ah oui,merci, ca fonctionne mtnt, il fallait le savoir!!!
0
Rejoignez-nous