Вернул назад реализацию Print с пробелами между
This commit is contained in:
parent
69fde2069b
commit
ace0233806
|
|
@ -15,7 +15,7 @@ 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 = "2";
|
public const string Build = "2";
|
||||||
public const string Revision = "3014";
|
public const string Revision = "3015";
|
||||||
|
|
||||||
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%=3015
|
||||||
|
%COREVERSION%=2
|
||||||
%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>
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
3.8.2.3014
|
3.8.2.3015
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.8.2.3014'
|
!define VERSION '3.8.2.3015'
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,6 @@ 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;
|
||||||
|
|
@ -1197,20 +1196,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])
|
||||||
|
|
@ -6571,19 +6570,17 @@ 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
|
||||||
PABCSystem.Print(Self,o);
|
if PrintDelimDefault<>'' then
|
||||||
{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
|
||||||
PABCSystem.Println(Self,o);
|
if o.Length <> 0 then
|
||||||
{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
|
||||||
|
|
@ -6593,7 +6590,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);
|
||||||
|
|
@ -6817,7 +6814,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// PointerOutput # PointerOutput subroutines
|
// Write - Writeln # Write subroutines
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
function PointerOutput.ToString: string;
|
function PointerOutput.ToString: string;
|
||||||
begin
|
begin
|
||||||
|
|
@ -6829,11 +6826,6 @@ begin
|
||||||
p := ptr;
|
p := ptr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
|
||||||
// Write - Writeln # Write subroutines
|
|
||||||
// -----------------------------------------------------
|
|
||||||
var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
|
|
||||||
|
|
||||||
procedure Write;
|
procedure Write;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
@ -6924,7 +6916,6 @@ 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);
|
||||||
|
|
@ -6941,7 +6932,6 @@ 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);
|
||||||
|
|
@ -6956,6 +6946,19 @@ 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);
|
||||||
|
|
@ -6972,7 +6975,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.WriteLine;
|
f.sw.WriteLine;
|
||||||
f.PrintState := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(f: Text; val: object);
|
procedure Writeln(f: Text; val: object);
|
||||||
|
|
@ -7018,28 +7020,14 @@ end;
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
begin
|
Write(s, PrintDelimDefault)
|
||||||
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
|
||||||
begin
|
Write(o, PrintDelimDefault)
|
||||||
if PrintState = 0 then
|
|
||||||
begin
|
|
||||||
Write(o);
|
|
||||||
PrintState := 1
|
|
||||||
end
|
|
||||||
else Write(PrintDelimDefault, o)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
Write(o)
|
Write(o)
|
||||||
end;
|
end;
|
||||||
|
|
@ -7048,37 +7036,27 @@ 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
|
||||||
if f.PrintState = 0 then
|
Write(f, args[i], PrintDelimDefault)
|
||||||
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])
|
||||||
|
|
@ -7088,7 +7066,6 @@ 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);
|
||||||
|
|
@ -7112,9 +7089,6 @@ 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
|
||||||
|
|
@ -7137,7 +7111,6 @@ 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
|
||||||
|
|
@ -7165,7 +7138,6 @@ 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);
|
||||||
|
|
@ -7206,7 +7178,6 @@ 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);
|
||||||
|
|
@ -7240,7 +7211,6 @@ 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;
|
||||||
|
|
||||||
|
|
@ -14180,7 +14150,6 @@ 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__;
|
||||||
|
|
@ -14200,7 +14169,6 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ type
|
||||||
[PrintAttribute(' ', 4, -5)]
|
[PrintAttribute(' ', 4, -5)]
|
||||||
property УчитсяВКШ: boolean read _inSunSchool;
|
property УчитсяВКШ: boolean read _inSunSchool;
|
||||||
end;}
|
end;}
|
||||||
|
|
||||||
|
///!#
|
||||||
Ученик = auto class
|
Ученик = auto class
|
||||||
Фамилия: string;
|
Фамилия: string;
|
||||||
Класс, Рост: integer;
|
Класс, Рост: integer;
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,6 @@ 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;
|
||||||
|
|
@ -1197,20 +1196,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])
|
||||||
|
|
@ -6571,19 +6570,17 @@ 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
|
||||||
PABCSystem.Print(Self,o);
|
if PrintDelimDefault<>'' then
|
||||||
{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
|
||||||
PABCSystem.Println(Self,o);
|
if o.Length <> 0 then
|
||||||
{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
|
||||||
|
|
@ -6593,7 +6590,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);
|
||||||
|
|
@ -6817,7 +6814,7 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
// PointerOutput # PointerOutput subroutines
|
// Write - Writeln # Write subroutines
|
||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
function PointerOutput.ToString: string;
|
function PointerOutput.ToString: string;
|
||||||
begin
|
begin
|
||||||
|
|
@ -6829,11 +6826,6 @@ begin
|
||||||
p := ptr;
|
p := ptr;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// -----------------------------------------------------
|
|
||||||
// Write - Writeln # Write subroutines
|
|
||||||
// -----------------------------------------------------
|
|
||||||
var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
|
|
||||||
|
|
||||||
procedure Write;
|
procedure Write;
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
@ -6924,7 +6916,6 @@ 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);
|
||||||
|
|
@ -6941,7 +6932,6 @@ 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);
|
||||||
|
|
@ -6956,6 +6946,19 @@ 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);
|
||||||
|
|
@ -6972,7 +6975,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.WriteLine;
|
f.sw.WriteLine;
|
||||||
f.PrintState := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Writeln(f: Text; val: object);
|
procedure Writeln(f: Text; val: object);
|
||||||
|
|
@ -7018,28 +7020,14 @@ end;
|
||||||
procedure Print(s: string);
|
procedure Print(s: string);
|
||||||
begin
|
begin
|
||||||
if PrintDelimDefault<>'' then
|
if PrintDelimDefault<>'' then
|
||||||
begin
|
Write(s, PrintDelimDefault)
|
||||||
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
|
||||||
begin
|
Write(o, PrintDelimDefault)
|
||||||
if PrintState = 0 then
|
|
||||||
begin
|
|
||||||
Write(o);
|
|
||||||
PrintState := 1
|
|
||||||
end
|
|
||||||
else Write(PrintDelimDefault, o)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
Write(o)
|
Write(o)
|
||||||
end;
|
end;
|
||||||
|
|
@ -7048,37 +7036,27 @@ 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
|
||||||
if f.PrintState = 0 then
|
Write(f, args[i], PrintDelimDefault)
|
||||||
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])
|
||||||
|
|
@ -7088,7 +7066,6 @@ 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);
|
||||||
|
|
@ -7112,9 +7089,6 @@ 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
|
||||||
|
|
@ -7137,7 +7111,6 @@ 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
|
||||||
|
|
@ -7165,7 +7138,6 @@ 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);
|
||||||
|
|
@ -7206,7 +7178,6 @@ 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);
|
||||||
|
|
@ -7240,7 +7211,6 @@ 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;
|
||||||
|
|
||||||
|
|
@ -14180,7 +14150,6 @@ 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__;
|
||||||
|
|
@ -14200,7 +14169,6 @@ 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.
Binary file not shown.
Loading…
Reference in a new issue