1. , , , , .
2. .
3
0,8
: . . . .
:
. .
1.
1. student .
2. , 30
30
3. OnClik.
procedure TForm1.Button1Click(Sender: TObject);
Var
f: TextFile; //
fName: String[80]; //
i: integer;
Begin
fName:= Editl.Text;
AssignFile(f, fName);
Rewrite(f); //
//
for i: =0 to Memo1.Lines.Count do //
writeln(f, Memo1.Lines[i]);
CloseFile(f); //
MessageDlg(' ',mtInformation,[mbOk],0);
End;
4. , . .
5. Editl . :\student\text1.txt
6. Memol .
7. .
8. student, text1.txt
2.
1.
procedure TForm1.Button2lick(Sender: TObject);
var
f: TextFile; //
fName: String[80]; //
buf: String[80]; //
begin
fName:= Edit1.Text;
AssignFile(f, fName);
Reset(f); //
if IOResult <> 0 then
begin
MessageDlg(' ' + fName, mtError,[mbOk],0);
exit;
end; //
while not EOF(f) do
begin
readln(f, buf); //
Memo1.Lines.Add(buf); // Memo1
end;
CloseFile(f); //
end;
2. .
3. .
, , . .
(, ) , . .
3.
|
|
.
1. , Memo1 Edit1 Clear.
2. , Memo1 Arial, 16
6 Memo RichEdit
1. . Memo, , . Memo . - , , , . Edit . .
2. Memo, Lines.
3. : Memo1.Lines.SaveToFile('c:\memo.txt'); memo.txt. .
4. : Memo1.LoadFromFile('c:\memo.txt');
5. : Memo1.Alignment:=taLeftJustify; .
6. : Memo1.Lines.Clear;
7. Edit1 OnChange, : if edit1.text<>'' then Memo1.Font.Size:=strtoint(Edit1.text);
8. OnClick Memo: Form1.Caption:=inttostr(memo1.CaretPos.y+1)+'/'+inttostr(Memo1.Lines.Count);
9. .
10. :
) Edit, , .
) , : / / .
.
11. Memo , RichEdit.
12. , RichEdit. , Alignment Paragraph. Font , SelAttributes.
13. .
7
, , , . , , , .
1. , . BitBtn, Additional.
2. , , : , , , . Glyph. : C:\Program Files\Common Files\Borland Shared\Images\Buttons.
3. SaveDialog, OpenDialog, FontDialog, ColorDialog Dialogs. , .
4. OpenDialog1 Title ( ): .
|
|
5. OpenDialog1 :
6. :
If OpenDialog1.Execute then Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
7. :
if FontDialog1.Execute then Memo1.Font:=FontDialog1.Font;
1. : , .
2. Memo.
3. . .
Memo RichEdit.