: .
Turbo Delphi . , ( ). . - , . , . .
Turbo Delphi ( 8):
8
Eof (fv) | True, False |
FilePos (fv) | , -. |
FileSize fv) | |
FileExists(< + >) | True, False |
AssignFile(fv,< + >) | ( ) |
CloseFile (fv) | ( ) |
Erase (fv) | |
Delete(< + >) | |
Read (fv, < >) | , |
Reset (fv) | |
Rewrite (fv) | |
Write (fv,< >) | , |
Seek(fv,< >) | |
Truncate(fv) | , , |
: , 8 fv .
20. . . .
Program Example_20;
{$APPTYPE CONSOLE}
Uses SysUtils;
Var
f: file of integer;
x, y: integer;
i, j: integer;
Begin
assignFile (f,'sort.dat');
Rewrite(f);
writeln(' :');
|
|
Read(x);
while x <> 999 do
begin
write(f,x); read(x);
end;
Readln;
loseFile(f);
Reset(f);
writeln(' :');
for i:= 1 to FileSize(f) do
begin
read(f,x); write(x:5);
end;
Writeln;
CloseFile(f);
Reset(f);
//
for i:= FileSize(f) -1 downto 1 do
for j:= 0 to i-1 do
begin
seek(f,j); read(f,x,y);
if x > y then begin
seek(f,j); write(f,y,x);
end;
end;
CloseFile(f);
Reset(f);
writeln(' :');
While not Eof(f) do
begin
read(f,x); write(x:5);
end;
CloseFile(f);
Readln
End.
(.14).
. 14. ( 20)
, 8, , , . , , c . : , , . . /. , . . :
- ;
- ;
- .
9.
. Turbo Delphi Integrated Debugging.
12.1. . ,
, : Tools ()│ Options ( ) │ Environment Options ( ). Compiling and Running Show compiler progress <OK>. , Project│ Compile ( < Ctrl+F9>). Turbo Delphi ( ). Compiling (.15).
.15.
Compiling (.16).
.16
, ( ), Messages (.17).
|
|
.17. ( ).
12.2. .
(run- time error) . (Exception). , . Tools │ Options│ Debagger Options │ Borland Debaggers │ Native OS Exceptions. Exceptions , Handled by Debugger < OK>.
, Optimization. Project│ Options│ Compiler. Code generation Optimization.
(.18) ( SetLength(Ar,n) Ar), Debugger Exception Notification.
.18.
12.3. .
, .
12.3.1.
(BreakPoints) , . (), ( ).
( < F5 > ). , . (.19).
.19.
, < F9 > ( < F4 >, Run ). Turbo Delphi . ().
< F7 > ( Trace Into Run, Trace), Turbo Delphi . . .
, Step ( < F8 >, Step Over Run).
, .
12.3.2.
:
- Watch List . : View │ Debug Windows │ Watches (). Watch List ( ) Add Watch ( ). Watch Properties ( ), Expression () ( ), , OK (.20).
|
|
.20. Watch Properties
Watch List (.21).
21. Watch List
Watch List :
1. < Ctrl+F5 >. Watch List.
2. , Debug , Add Watch at Cursor.
3. Run Add Watch. Watch Properties Watch List.
4. Watch List , Watch Properties < Ctrl+A >.
Expression Watch Properties . (Turbo Delphi , , ).
Watch List . Turbo Delphi . , ( Default).
- Evaluate/Modify . - . . :
- < Ctrl+F7 >;
- Evaluate/ Modify Run.
Turbo Delphi Evaluate/Modify Expression, , .. Expression . Evaluate/Modify , New Value Modify. Turbo Delphi . , Result .
21. , 10 . 22.
program Example_21;
{$ APPTYPE CONSOLE}
Uses SysUtils;
Var i: integer;
R: real48;
RStr, Istr: shortstring;
Begin
for i:= 1 to 20 do
begin
R:= Sqrt (5*i);
Str (R:10:5, RStr);
Str (5*i:4, IStr);
writeln(IStr+':'+RStr);
end;
readln
End.
.22. ( 21) valuate/Modify
Evaluate/ Modify , .
. , <F7> ( Trace into), , i . Evaluate/Modify i Expression; Evaluate ( <Enter>). i=1 Result New Value. New Value 1 9 Modify , . Evaluate/Modify Modify .23.
.23. Evaluate/Modify
(<F7>) . .24.
|
|
.24. ( 21) Evaluate/Modify
, i.
1. .., .., .. : .: ../ ....-.:- ...,2008.-288 .
2. . + = . . . - .: , 1985.-326 .
3. Turbo Delphi: -.2 /. , .., .., ..; .... - .:- ..., 2011.-99 .: .
4. Turbo Delphi: -.3 /.., .., .., ..; .... - .:- ..., 2013.-82 .: .
4. : .-. /..-.- ...,2007.-48 .:.
1. ................. 3
2. .... ........10
3. .............. 16
3.1. .
- .................................. 16
3.2. .
.................................. 22
4. 28
5.
................................. .......... 33
6. ...... 39
7. .......... 43
8. ............... 45
9.
( )................................ 52
10. ........... 55
11. ........62
12. ................................... 65
12.1. . , .............65
12.2. . .... ...68
12.3. . ...... 69
12.3.1. ...................... 69
12.3.2. ................... 70
........................................... 75