unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type userrec = RECORD username: STRING[8]; password: STRING[6]; level : INTEGER; end; userlist = ARRAY[1..5] of userrec; TForm3 = class(TForm) BTexit: TButton; Label1: TLabel; Label2: TLabel; EDpass: TEdit; Label3: TLabel; EDlevel: TEdit; EDuser: TEdit; BTshow: TButton; BTsave: TButton; procedure FormCreate(Sender: TObject); procedure BTexitClick(Sender: TObject); procedure EDuserChange(Sender: TObject); procedure BTshowClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var temp, logonrec : userrec; logonlist: userlist; logonfile: FILE of userrec; count: INTEGER; numberofrecs: INTEGER; Form3: TForm3; position: integer; implementation uses Unit1; {$R *.dfm} procedure TForm3.FormCreate(Sender: TObject); begin WHILE NOT EOF (logonfile) DO BEGIN ASSIGNFILE (logonfile, 'passwords.pwd'); inc(count); READ(logonfile, logonlist [count]); END; CLOSEFILE(logonfile); numberofrecs:=count; end; procedure TForm3.BTexitClick(Sender: TObject); begin Form3.close; end; procedure TForm3.BTshowClick(Sender: TObject); begin EDuser.text:=logonfile[position].username; end; end.