Print теперь разделяет элементы пробелами. В конце строки пробел не выводится
Версия 3.8.2
This commit is contained in:
parent
611c7b0e18
commit
69fde2069b
|
|
@ -14,8 +14,8 @@ internal static class RevisionClass
|
||||||
{
|
{
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "8";
|
public const string Minor = "8";
|
||||||
public const string Build = "1";
|
public const string Build = "2";
|
||||||
public const string Revision = "3007";
|
public const string Revision = "3014";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
|
%COREVERSION%=2
|
||||||
|
%REVISION%=3014
|
||||||
%MINOR%=8
|
%MINOR%=8
|
||||||
%REVISION%=3007
|
|
||||||
%COREVERSION%=1
|
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
<table border=0 cellpadding=5><tr><td><code><b>function</b> Deserialize(filename: string): object;</code>
|
<table border=0 cellpadding=5><tr><td><code><b>function</b> Deserialize(filename: string): object;</code>
|
||||||
<br> Äåñåðèàëèçóåò îáúåêò èç ôàéëà</td></tr>
|
<br> Äåñåðèàëèçóåò îáúåêò èç ôàéëà</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Print(a,b,...);</code>
|
<tr><td><code><b>procedure</b> Print(a,b,...);</code>
|
||||||
<br> Выводит значения a,b,... на экран, после каждого значения выводит пробел</td></tr>
|
<br> Выводит значения a,b,... на экран, разделяя их пробелами</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Print(f: Text; a,b,...);</code>
|
<tr><td><code><b>procedure</b> Print(f: Text; a,b,...);</code>
|
||||||
<br> Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел</td></tr>
|
<br> Выводит значения a,b,... в текстовый файл f, разделяя их пробелами</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Println(a,b,...);</code>
|
<tr><td><code><b>procedure</b> Println(a,b,...);</code>
|
||||||
<br> Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку</td></tr>
|
<br> Выводит значения a,b,... на экран, разделяя их пробелами, и переходит на новую строку</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Println(f: Text; a,b,...);</code>
|
<tr><td><code><b>procedure</b> Println(f: Text; a,b,...);</code>
|
||||||
<br> Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку</td></tr>
|
<br> Выводит значения a,b,... в текстовый файл f, разделяя их пробелами, и переходит на новую строку</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Serialize(filename: string; obj: object);</code>
|
<tr><td><code><b>procedure</b> Serialize(filename: string; obj: object);</code>
|
||||||
<br> Ñåðèàëèçóåò îáúåêò â ôàéë (îáúåêò äîëæåí èìåòü àòðèáóò [Serializable])</td></tr>
|
<br> Ñåðèàëèçóåò îáúåêò â ôàéë (îáúåêò äîëæåí èìåòü àòðèáóò [Serializable])</td></tr>
|
||||||
<tr><td><code><b>procedure</b> Write(a,b,...);</code>
|
<tr><td><code><b>procedure</b> Write(a,b,...);</code>
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
<br> Ðèñóåò èçîáðàæåíèå èç áèòìàïà â ïîçèöèè (x,y) ðàçìåðà w íà h</td></tr>
|
<br> Ðèñóåò èçîáðàæåíèå èç áèòìàïà â ïîçèöèè (x,y) ðàçìåðà w íà h</td></tr>
|
||||||
<tr><td><code><b>procedure</b> DrawImageUnscaled(x,y: real; fname: string);</code>
|
<tr><td><code><b>procedure</b> DrawImageUnscaled(x,y: real; fname: string);</code>
|
||||||
<br> Ðèñóåò íåìàñøòàáèðîâàííîå èçîáðàæåíèå èç ôàéëà fname â ïîçèöèè (x,y)</td></tr>
|
<br> Ðèñóåò íåìàñøòàáèðîâàííîå èçîáðàæåíèå èç ôàéëà fname â ïîçèöèè (x,y)</td></tr>
|
||||||
<tr><td><code><b>procedure</b> DrawVideo(x,y: real; fname: string);</code>
|
<tr><td><code><b>procedure</b> DrawVideo(x,y,w,h: real; fname: string);</code>
|
||||||
<br> Âûâîäèò âèäåîèç ôàéëà fname â ïîçèöèþ (x,y)</td></tr>
|
<br> Âûâîäèò âèäåî èç ôàéëà fname â ïîçèöèþ (x,y) â ïðÿìîóãîëüíèê ðàçìåðîì (w,h)</td></tr>
|
||||||
<tr><td><code><b>function</b> ImageHeight(fname: string): integer;</code>
|
<tr><td><code><b>function</b> ImageHeight(fname: string): integer;</code>
|
||||||
<br> Âûñîòà èçîáðàæåíèÿ â ïèêñåëàõ</td></tr>
|
<br> Âûñîòà èçîáðàæåíèÿ â ïèêñåëàõ</td></tr>
|
||||||
<tr><td><code><b>function</b> ImageSize(fname: string): (integer,integer);</code>
|
<tr><td><code><b>function</b> ImageSize(fname: string): (integer,integer);</code>
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
3.8.1.3007
|
3.8.2.3014
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.8.1.3007'
|
!define VERSION '3.8.2.3014'
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,7 @@ type
|
||||||
fi: FileInfo;
|
fi: FileInfo;
|
||||||
sr: StreamReader;
|
sr: StreamReader;
|
||||||
sw: TextWriter;
|
sw: TextWriter;
|
||||||
|
PrintState: integer := 0; // 0 - до любого вывода и в начале строки
|
||||||
public
|
public
|
||||||
/// Возвращает значение типа integer, введенное из текстового файла
|
/// Возвращает значение типа integer, введенное из текстового файла
|
||||||
function ReadInteger: integer;
|
function ReadInteger: integer;
|
||||||
|
|
@ -1196,20 +1197,20 @@ procedure WriteFormat(f: Text; formatstr: string; params args: array of object);
|
||||||
procedure WritelnFormat(f: Text; formatstr: string; params args: array of object);
|
procedure WritelnFormat(f: Text; formatstr: string; params args: array of object);
|
||||||
|
|
||||||
///- procedure Print(a,b,...);
|
///- procedure Print(a,b,...);
|
||||||
/// Выводит значения a,b,... на экран, после каждого значения выводит пробел
|
/// Выводит значения a,b,... на экран, разделяя их пробелами
|
||||||
procedure Print(o: object);
|
procedure Print(o: object);
|
||||||
///--
|
///--
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
///--
|
///--
|
||||||
procedure Print(params args: array of object);
|
procedure Print(params args: array of object);
|
||||||
///- procedure Print(f: Text; a,b,...);
|
///- procedure Print(f: Text; a,b,...);
|
||||||
/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел
|
/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами
|
||||||
procedure Print(f: Text; params args: array of object);
|
procedure Print(f: Text; params args: array of object);
|
||||||
///- procedure Println(a,b,...);
|
///- procedure Println(a,b,...);
|
||||||
/// Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку
|
/// Выводит значения a,b,... на экран, разделяя их пробелами, и переходит на новую строку
|
||||||
procedure Println(params args: array of object);
|
procedure Println(params args: array of object);
|
||||||
///- procedure Println(f: Text; a,b,...);
|
///- procedure Println(f: Text; a,b,...);
|
||||||
/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку
|
/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами, и переходит на новую строку
|
||||||
procedure Println(f: Text; params args: array of object);
|
procedure Println(f: Text; params args: array of object);
|
||||||
|
|
||||||
/// Сериализует объект в файл (объект должен иметь атрибут [Serializable])
|
/// Сериализует объект в файл (объект должен иметь атрибут [Serializable])
|
||||||
|
|
@ -6570,17 +6571,19 @@ procedure Text.Writeln(params o: array of Object) := PABCSystem.Writeln(Self, o)
|
||||||
|
|
||||||
procedure Text.Print(params o: array of Object);
|
procedure Text.Print(params o: array of Object);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
PABCSystem.Print(Self,o);
|
||||||
|
{if PrintDelimDefault<>'' then
|
||||||
foreach var s in o do
|
foreach var s in o do
|
||||||
PABCSystem.Write(Self, s, PrintDelimDefault)
|
PABCSystem.Write(Self, s, PrintDelimDefault)
|
||||||
else
|
else
|
||||||
foreach var s in o do
|
foreach var s in o do
|
||||||
PABCSystem.Write(Self, s)
|
PABCSystem.Write(Self, s)}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Text.Println(params o: array of Object);
|
procedure Text.Println(params o: array of Object);
|
||||||
begin
|
begin
|
||||||
if o.Length <> 0 then
|
PABCSystem.Println(Self,o);
|
||||||
|
{if o.Length <> 0 then
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
for var i:=0 to o.Length-2 do
|
for var i:=0 to o.Length-2 do
|
||||||
|
|
@ -6590,7 +6593,7 @@ begin
|
||||||
PABCSystem.Write(Self, o[i]);
|
PABCSystem.Write(Self, o[i]);
|
||||||
PABCSystem.Write(Self, o.Last);
|
PABCSystem.Write(Self, o.Last);
|
||||||
end;
|
end;
|
||||||
PABCSystem.Writeln(Self);
|
PABCSystem.Writeln(Self);}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Text.Eof := PABCSystem.Eof(Self);
|
function Text.Eof := PABCSystem.Eof(Self);
|
||||||
|
|
@ -6814,7 +6817,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// Write - Writeln # Write subroutines
|
// PointerOutput # PointerOutput subroutines
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
function PointerOutput.ToString: string;
|
function PointerOutput.ToString: string;
|
||||||
begin
|
begin
|
||||||
|
|
@ -6826,6 +6829,11 @@ begin
|
||||||
p := ptr;
|
p := ptr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// -----------------------------------------------------
|
||||||
|
// Write - Writeln # Write subroutines
|
||||||
|
// -----------------------------------------------------
|
||||||
|
var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
|
||||||
|
|
||||||
procedure Write;
|
procedure Write;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
@ -6916,6 +6924,7 @@ begin
|
||||||
if output.sw is StreamWriter then
|
if output.sw is StreamWriter then
|
||||||
writeln_in_output
|
writeln_in_output
|
||||||
else CurrentIOSystem.Writeln;
|
else CurrentIOSystem.Writeln;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(params args: array of object);
|
procedure Writeln(params args: array of object);
|
||||||
|
|
@ -6932,6 +6941,7 @@ begin
|
||||||
CurrentIOSystem.Write(args[i]);
|
CurrentIOSystem.Write(args[i]);
|
||||||
CurrentIOSystem.Writeln;
|
CurrentIOSystem.Writeln;
|
||||||
end;
|
end;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Write(f: Text);
|
procedure Write(f: Text);
|
||||||
|
|
@ -6946,19 +6956,6 @@ begin
|
||||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
||||||
|
|
||||||
f.sw.Write(StructuredObjectToString(val));
|
f.sw.Write(StructuredObjectToString(val));
|
||||||
{if val = nil then
|
|
||||||
begin
|
|
||||||
f.sw.Write('nil');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
case System.Type.GetTypeCode(val.GetType) of
|
|
||||||
TypeCode.Double,
|
|
||||||
TypeCode.Single,
|
|
||||||
TypeCode.Decimal:
|
|
||||||
f.sw.Write(FormatFloatNumber(val.ToString));
|
|
||||||
else
|
|
||||||
f.sw.Write(val)
|
|
||||||
end;}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Write(f: Text; params args: array of object);
|
procedure Write(f: Text; params args: array of object);
|
||||||
|
|
@ -6975,6 +6972,7 @@ begin
|
||||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
||||||
|
|
||||||
f.sw.WriteLine;
|
f.sw.WriteLine;
|
||||||
|
f.PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(f: Text; val: object);
|
procedure Writeln(f: Text; val: object);
|
||||||
|
|
@ -7020,14 +7018,28 @@ end;
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
Write(s, PrintDelimDefault)
|
begin
|
||||||
|
if PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(s);
|
||||||
|
PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(PrintDelimDefault, s)
|
||||||
|
end
|
||||||
else Write(s)
|
else Write(s)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Print(o: object);
|
procedure Print(o: object);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
Write(o, PrintDelimDefault)
|
begin
|
||||||
|
if PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(o);
|
||||||
|
PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(PrintDelimDefault, o)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Write(o)
|
Write(o)
|
||||||
end;
|
end;
|
||||||
|
|
@ -7036,27 +7048,37 @@ procedure Print(params args: array of object);
|
||||||
begin
|
begin
|
||||||
if args.Length = 0 then
|
if args.Length = 0 then
|
||||||
exit;
|
exit;
|
||||||
if PrintDelimDefault<>'' then
|
{if PrintDelimDefault<>'' then
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(args[i], PrintDelimDefault)
|
Write(args[i], PrintDelimDefault)
|
||||||
else
|
else
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(args[i])
|
Write(args[i])}
|
||||||
|
for var i := 0 to args.Length - 1 do
|
||||||
|
Print(args[i])
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Println(params args: array of object);
|
procedure Println(params args: array of object);
|
||||||
begin
|
begin
|
||||||
Print(args);
|
Print(args);
|
||||||
Writeln;
|
Writeln;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var FilePrintState := 0;// Хранить FilePrintState в типе Text!!!
|
||||||
|
|
||||||
procedure Print(f: Text; params args: array of object);
|
procedure Print(f: Text; params args: array of object);
|
||||||
begin
|
begin
|
||||||
if args.Length = 0 then
|
if args.Length = 0 then
|
||||||
exit;
|
exit;
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(f, args[i], PrintDelimDefault)
|
if f.PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(f, args[i]);
|
||||||
|
f.PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(f, PrintDelimDefault, args[i])
|
||||||
else
|
else
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(f, args[i])
|
Write(f, args[i])
|
||||||
|
|
@ -7066,6 +7088,7 @@ procedure Println(f: Text; params args: array of object);
|
||||||
begin
|
begin
|
||||||
Print(f, args);
|
Print(f, args);
|
||||||
Writeln(f);
|
Writeln(f);
|
||||||
|
f.PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Serialize(filename: string; obj: object);
|
procedure Serialize(filename: string; obj: object);
|
||||||
|
|
@ -7089,6 +7112,9 @@ end;
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
procedure Assign(f: Text; name: string);
|
procedure Assign(f: Text; name: string);
|
||||||
begin
|
begin
|
||||||
|
f.PrintState := 0;
|
||||||
|
if f = input then
|
||||||
|
PrintState := 0;
|
||||||
try
|
try
|
||||||
f.fi := System.IO.FileInfo.Create(name);
|
f.fi := System.IO.FileInfo.Create(name);
|
||||||
except
|
except
|
||||||
|
|
@ -7111,6 +7137,7 @@ procedure AssignFile(f: Text; name: string) := Assign(f, name);
|
||||||
|
|
||||||
procedure Close(f: Text);
|
procedure Close(f: Text);
|
||||||
begin
|
begin
|
||||||
|
f.PrintState := 0;
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
if f.sr <> nil then
|
if f.sr <> nil then
|
||||||
|
|
@ -7138,6 +7165,7 @@ procedure Reset(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
if f.sr = nil then
|
if f.sr = nil then
|
||||||
begin
|
begin
|
||||||
f.sr := new StreamReader(f.fi.FullName, en);
|
f.sr := new StreamReader(f.fi.FullName, en);
|
||||||
|
|
@ -7178,6 +7206,7 @@ procedure Rewrite(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
if f.sw = nil then
|
if f.sw = nil then
|
||||||
begin
|
begin
|
||||||
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
||||||
|
|
@ -7211,6 +7240,7 @@ procedure Append(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
@ -14150,6 +14180,7 @@ begin
|
||||||
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
|
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
|
||||||
__FixPointer(nil);
|
__FixPointer(nil);
|
||||||
StartTime := DateTime.Now;
|
StartTime := DateTime.Now;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure __InitModule__;
|
procedure __InitModule__;
|
||||||
|
|
@ -14169,6 +14200,7 @@ end;
|
||||||
|
|
||||||
procedure __FinalizeModule__;
|
procedure __FinalizeModule__;
|
||||||
begin
|
begin
|
||||||
|
PrintState := 0;
|
||||||
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
|
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
|
||||||
output.sw.Close;
|
output.sw.Close;
|
||||||
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
|
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
PrintDelimDefault := ' ';
|
||||||
finalization
|
finalization
|
||||||
|
|
||||||
FinExam;
|
FinExam;
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,7 @@ type
|
||||||
fi: FileInfo;
|
fi: FileInfo;
|
||||||
sr: StreamReader;
|
sr: StreamReader;
|
||||||
sw: TextWriter;
|
sw: TextWriter;
|
||||||
|
PrintState: integer := 0; // 0 - до любого вывода и в начале строки
|
||||||
public
|
public
|
||||||
/// Возвращает значение типа integer, введенное из текстового файла
|
/// Возвращает значение типа integer, введенное из текстового файла
|
||||||
function ReadInteger: integer;
|
function ReadInteger: integer;
|
||||||
|
|
@ -1196,20 +1197,20 @@ procedure WriteFormat(f: Text; formatstr: string; params args: array of object);
|
||||||
procedure WritelnFormat(f: Text; formatstr: string; params args: array of object);
|
procedure WritelnFormat(f: Text; formatstr: string; params args: array of object);
|
||||||
|
|
||||||
///- procedure Print(a,b,...);
|
///- procedure Print(a,b,...);
|
||||||
/// Выводит значения a,b,... на экран, после каждого значения выводит пробел
|
/// Выводит значения a,b,... на экран, разделяя их пробелами
|
||||||
procedure Print(o: object);
|
procedure Print(o: object);
|
||||||
///--
|
///--
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
///--
|
///--
|
||||||
procedure Print(params args: array of object);
|
procedure Print(params args: array of object);
|
||||||
///- procedure Print(f: Text; a,b,...);
|
///- procedure Print(f: Text; a,b,...);
|
||||||
/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел
|
/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами
|
||||||
procedure Print(f: Text; params args: array of object);
|
procedure Print(f: Text; params args: array of object);
|
||||||
///- procedure Println(a,b,...);
|
///- procedure Println(a,b,...);
|
||||||
/// Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку
|
/// Выводит значения a,b,... на экран, разделяя их пробелами, и переходит на новую строку
|
||||||
procedure Println(params args: array of object);
|
procedure Println(params args: array of object);
|
||||||
///- procedure Println(f: Text; a,b,...);
|
///- procedure Println(f: Text; a,b,...);
|
||||||
/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку
|
/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами, и переходит на новую строку
|
||||||
procedure Println(f: Text; params args: array of object);
|
procedure Println(f: Text; params args: array of object);
|
||||||
|
|
||||||
/// Сериализует объект в файл (объект должен иметь атрибут [Serializable])
|
/// Сериализует объект в файл (объект должен иметь атрибут [Serializable])
|
||||||
|
|
@ -6570,17 +6571,19 @@ procedure Text.Writeln(params o: array of Object) := PABCSystem.Writeln(Self, o)
|
||||||
|
|
||||||
procedure Text.Print(params o: array of Object);
|
procedure Text.Print(params o: array of Object);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
PABCSystem.Print(Self,o);
|
||||||
|
{if PrintDelimDefault<>'' then
|
||||||
foreach var s in o do
|
foreach var s in o do
|
||||||
PABCSystem.Write(Self, s, PrintDelimDefault)
|
PABCSystem.Write(Self, s, PrintDelimDefault)
|
||||||
else
|
else
|
||||||
foreach var s in o do
|
foreach var s in o do
|
||||||
PABCSystem.Write(Self, s)
|
PABCSystem.Write(Self, s)}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Text.Println(params o: array of Object);
|
procedure Text.Println(params o: array of Object);
|
||||||
begin
|
begin
|
||||||
if o.Length <> 0 then
|
PABCSystem.Println(Self,o);
|
||||||
|
{if o.Length <> 0 then
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
for var i:=0 to o.Length-2 do
|
for var i:=0 to o.Length-2 do
|
||||||
|
|
@ -6590,7 +6593,7 @@ begin
|
||||||
PABCSystem.Write(Self, o[i]);
|
PABCSystem.Write(Self, o[i]);
|
||||||
PABCSystem.Write(Self, o.Last);
|
PABCSystem.Write(Self, o.Last);
|
||||||
end;
|
end;
|
||||||
PABCSystem.Writeln(Self);
|
PABCSystem.Writeln(Self);}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Text.Eof := PABCSystem.Eof(Self);
|
function Text.Eof := PABCSystem.Eof(Self);
|
||||||
|
|
@ -6814,7 +6817,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// Write - Writeln # Write subroutines
|
// PointerOutput # PointerOutput subroutines
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
function PointerOutput.ToString: string;
|
function PointerOutput.ToString: string;
|
||||||
begin
|
begin
|
||||||
|
|
@ -6826,6 +6829,11 @@ begin
|
||||||
p := ptr;
|
p := ptr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// -----------------------------------------------------
|
||||||
|
// Write - Writeln # Write subroutines
|
||||||
|
// -----------------------------------------------------
|
||||||
|
var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
|
||||||
|
|
||||||
procedure Write;
|
procedure Write;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
@ -6916,6 +6924,7 @@ begin
|
||||||
if output.sw is StreamWriter then
|
if output.sw is StreamWriter then
|
||||||
writeln_in_output
|
writeln_in_output
|
||||||
else CurrentIOSystem.Writeln;
|
else CurrentIOSystem.Writeln;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(params args: array of object);
|
procedure Writeln(params args: array of object);
|
||||||
|
|
@ -6932,6 +6941,7 @@ begin
|
||||||
CurrentIOSystem.Write(args[i]);
|
CurrentIOSystem.Write(args[i]);
|
||||||
CurrentIOSystem.Writeln;
|
CurrentIOSystem.Writeln;
|
||||||
end;
|
end;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Write(f: Text);
|
procedure Write(f: Text);
|
||||||
|
|
@ -6946,19 +6956,6 @@ begin
|
||||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
||||||
|
|
||||||
f.sw.Write(StructuredObjectToString(val));
|
f.sw.Write(StructuredObjectToString(val));
|
||||||
{if val = nil then
|
|
||||||
begin
|
|
||||||
f.sw.Write('nil');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
case System.Type.GetTypeCode(val.GetType) of
|
|
||||||
TypeCode.Double,
|
|
||||||
TypeCode.Single,
|
|
||||||
TypeCode.Decimal:
|
|
||||||
f.sw.Write(FormatFloatNumber(val.ToString));
|
|
||||||
else
|
|
||||||
f.sw.Write(val)
|
|
||||||
end;}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Write(f: Text; params args: array of object);
|
procedure Write(f: Text; params args: array of object);
|
||||||
|
|
@ -6975,6 +6972,7 @@ begin
|
||||||
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
|
||||||
|
|
||||||
f.sw.WriteLine;
|
f.sw.WriteLine;
|
||||||
|
f.PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(f: Text; val: object);
|
procedure Writeln(f: Text; val: object);
|
||||||
|
|
@ -7020,14 +7018,28 @@ end;
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
Write(s, PrintDelimDefault)
|
begin
|
||||||
|
if PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(s);
|
||||||
|
PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(PrintDelimDefault, s)
|
||||||
|
end
|
||||||
else Write(s)
|
else Write(s)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Print(o: object);
|
procedure Print(o: object);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
Write(o, PrintDelimDefault)
|
begin
|
||||||
|
if PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(o);
|
||||||
|
PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(PrintDelimDefault, o)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Write(o)
|
Write(o)
|
||||||
end;
|
end;
|
||||||
|
|
@ -7036,27 +7048,37 @@ procedure Print(params args: array of object);
|
||||||
begin
|
begin
|
||||||
if args.Length = 0 then
|
if args.Length = 0 then
|
||||||
exit;
|
exit;
|
||||||
if PrintDelimDefault<>'' then
|
{if PrintDelimDefault<>'' then
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(args[i], PrintDelimDefault)
|
Write(args[i], PrintDelimDefault)
|
||||||
else
|
else
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(args[i])
|
Write(args[i])}
|
||||||
|
for var i := 0 to args.Length - 1 do
|
||||||
|
Print(args[i])
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Println(params args: array of object);
|
procedure Println(params args: array of object);
|
||||||
begin
|
begin
|
||||||
Print(args);
|
Print(args);
|
||||||
Writeln;
|
Writeln;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var FilePrintState := 0;// Хранить FilePrintState в типе Text!!!
|
||||||
|
|
||||||
procedure Print(f: Text; params args: array of object);
|
procedure Print(f: Text; params args: array of object);
|
||||||
begin
|
begin
|
||||||
if args.Length = 0 then
|
if args.Length = 0 then
|
||||||
exit;
|
exit;
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(f, args[i], PrintDelimDefault)
|
if f.PrintState = 0 then
|
||||||
|
begin
|
||||||
|
Write(f, args[i]);
|
||||||
|
f.PrintState := 1
|
||||||
|
end
|
||||||
|
else Write(f, PrintDelimDefault, args[i])
|
||||||
else
|
else
|
||||||
for var i := 0 to args.length - 1 do
|
for var i := 0 to args.length - 1 do
|
||||||
Write(f, args[i])
|
Write(f, args[i])
|
||||||
|
|
@ -7066,6 +7088,7 @@ procedure Println(f: Text; params args: array of object);
|
||||||
begin
|
begin
|
||||||
Print(f, args);
|
Print(f, args);
|
||||||
Writeln(f);
|
Writeln(f);
|
||||||
|
f.PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Serialize(filename: string; obj: object);
|
procedure Serialize(filename: string; obj: object);
|
||||||
|
|
@ -7089,6 +7112,9 @@ end;
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
procedure Assign(f: Text; name: string);
|
procedure Assign(f: Text; name: string);
|
||||||
begin
|
begin
|
||||||
|
f.PrintState := 0;
|
||||||
|
if f = input then
|
||||||
|
PrintState := 0;
|
||||||
try
|
try
|
||||||
f.fi := System.IO.FileInfo.Create(name);
|
f.fi := System.IO.FileInfo.Create(name);
|
||||||
except
|
except
|
||||||
|
|
@ -7111,6 +7137,7 @@ procedure AssignFile(f: Text; name: string) := Assign(f, name);
|
||||||
|
|
||||||
procedure Close(f: Text);
|
procedure Close(f: Text);
|
||||||
begin
|
begin
|
||||||
|
f.PrintState := 0;
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
if f.sr <> nil then
|
if f.sr <> nil then
|
||||||
|
|
@ -7138,6 +7165,7 @@ procedure Reset(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
if f.sr = nil then
|
if f.sr = nil then
|
||||||
begin
|
begin
|
||||||
f.sr := new StreamReader(f.fi.FullName, en);
|
f.sr := new StreamReader(f.fi.FullName, en);
|
||||||
|
|
@ -7178,6 +7206,7 @@ procedure Rewrite(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
if f.sw = nil then
|
if f.sw = nil then
|
||||||
begin
|
begin
|
||||||
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
f.sw := new StreamWriter(f.fi.FullName, False, en);
|
||||||
|
|
@ -7211,6 +7240,7 @@ procedure Append(f: Text; en: Encoding);
|
||||||
begin
|
begin
|
||||||
if f.fi = nil then
|
if f.fi = nil then
|
||||||
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
|
||||||
|
f.PrintState := 0;
|
||||||
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
f.sw := new StreamWriter(f.fi.FullName, True, en);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
@ -14150,6 +14180,7 @@ begin
|
||||||
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
|
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
|
||||||
__FixPointer(nil);
|
__FixPointer(nil);
|
||||||
StartTime := DateTime.Now;
|
StartTime := DateTime.Now;
|
||||||
|
PrintState := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure __InitModule__;
|
procedure __InitModule__;
|
||||||
|
|
@ -14169,6 +14200,7 @@ end;
|
||||||
|
|
||||||
procedure __FinalizeModule__;
|
procedure __FinalizeModule__;
|
||||||
begin
|
begin
|
||||||
|
PrintState := 0;
|
||||||
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
|
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
|
||||||
output.sw.Close;
|
output.sw.Close;
|
||||||
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
|
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue