
26.05.2010, 20:24
|
 |
Прохожий
|
|
Регистрация: 23.05.2010
Адрес: Москва
Сообщения: 29
Репутация: 10
|
|
а вот еще:
есть короче прога:
Код:
unit rez;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
Label1: TLabel;
Edit1: TEdit;
Memo1: TMemo;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
File1: TMenuItem;
Exit1: TMenuItem;
Open1: TMenuItem;
OpenDialog1: TOpenDialog;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
procedure Exit1Click(Sender: TObject);
procedure Open1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var fl:text;
fl1:TEXT;
word,sentence,str:integer;
ch:char;
flug:boolean;
procedure readproc(var fl:text;var w,sen,st:integer);
var ch2:char;
begin
read(fl,ch2);
if ch2=' 'then w:=w+1;
if ch2='.'then sen:=sen+1;
if ch2=#13then st:=st+1;
end;
procedure writeproc(var fl:text;fn:tfilename;w,sen,st:integer);
begin
AssignFile(fl,FN);
rewrite(fl);
writeln(fl,'wwords:',inttostr(w));
writeln(fl,'sentences:',inttostr(sen));
writeln(fl,'strings:',inttostr(st));
closefile(fl);
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Open1Click(Sender: TObject);
begin
if opendialog1.execute
then begin
edit1.Text:=opendialog1.filename;
memo1.Lines.LoadFromFile(edit1.Text);
AssignFile(fl,edit1.Text);
flug:=true;
end;
end;
end.
Admin: Напоминаю про теги!
и нужно короче сделать пролистывание файлов
именно файлов!!!
сможете подсказать?
|