diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 68d204325..8ef23ebe3 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "2"; - public const string Revision = "3014"; + public const string Revision = "3015"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index fb1202ed9..2541d7c76 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=2 -%REVISION%=3014 %MINOR%=8 +%REVISION%=3015 +%COREVERSION%=2 %MAJOR%=3 diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html index 7c13e9384..aec417fac 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Write subroutines.html @@ -12,13 +12,13 @@
function Deserialize(filename: string): object;
|
procedure Print(a,b,...);
-a,b,... , |
procedure Print(f: Text; a,b,...);
-a,b,... f, |
procedure Println(a,b,...);
-a,b,... , , |
procedure Println(f: Text; a,b,...);
-a,b,... f, , |
procedure Serialize(filename: string; obj: object);
( [Serializable]) |
procedure Write(a,b,...);
diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt
index f66adf308..99b28020a 100644
--- a/Release/pabcversion.txt
+++ b/Release/pabcversion.txt
@@ -1 +1 @@
-3.8.2.3014
+3.8.2.3015
diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh
index 53157f847..fca358a07 100644
--- a/ReleaseGenerators/PascalABCNET_version.nsh
+++ b/ReleaseGenerators/PascalABCNET_version.nsh
@@ -1 +1 @@
-!define VERSION '3.8.2.3014'
+!define VERSION '3.8.2.3015'
diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas
index d87755dd6..4d5638e20 100644
--- a/TestSuite/CompilationSamples/PABCSystem.pas
+++ b/TestSuite/CompilationSamples/PABCSystem.pas
@@ -379,7 +379,6 @@ type
fi: FileInfo;
sr: StreamReader;
sw: TextWriter;
- PrintState: integer := 0; // 0 - до любого вывода и в начале строки
public
/// Возвращает значение типа 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 Print(a,b,...);
-/// Выводит значения a,b,... на экран, разделяя их пробелами
+/// Выводит значения a,b,... на экран, после каждого значения выводит пробел
procedure Print(o: object);
///--
procedure Print(s: string);
///--
procedure Print(params args: array of object);
///- procedure Print(f: Text; a,b,...);
-/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами
+/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел
procedure Print(f: Text; params args: array of object);
///- procedure Println(a,b,...);
-/// Выводит значения a,b,... на экран, разделяя их пробелами, и переходит на новую строку
+/// Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку
procedure Println(params args: array of object);
///- procedure Println(f: Text; a,b,...);
-/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами, и переходит на новую строку
+/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку
procedure Println(f: Text; params args: array of object);
/// Сериализует объект в файл (объект должен иметь атрибут [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);
begin
- PABCSystem.Print(Self,o);
- {if PrintDelimDefault<>'' then
+ if PrintDelimDefault<>'' then
foreach var s in o do
PABCSystem.Write(Self, s, PrintDelimDefault)
else
foreach var s in o do
- PABCSystem.Write(Self, s)}
+ PABCSystem.Write(Self, s)
end;
procedure Text.Println(params o: array of Object);
begin
- PABCSystem.Println(Self,o);
- {if o.Length <> 0 then
+ if o.Length <> 0 then
begin
if PrintDelimDefault<>'' then
for var i:=0 to o.Length-2 do
@@ -6593,7 +6590,7 @@ begin
PABCSystem.Write(Self, o[i]);
PABCSystem.Write(Self, o.Last);
end;
- PABCSystem.Writeln(Self);}
+ PABCSystem.Writeln(Self);
end;
function Text.Eof := PABCSystem.Eof(Self);
@@ -6817,7 +6814,7 @@ begin
end;
// -----------------------------------------------------
-// PointerOutput # PointerOutput subroutines
+// Write - Writeln # Write subroutines
// -----------------------------------------------------
function PointerOutput.ToString: string;
begin
@@ -6829,11 +6826,6 @@ begin
p := ptr;
end;
-// -----------------------------------------------------
-// Write - Writeln # Write subroutines
-// -----------------------------------------------------
-var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
-
procedure Write;
begin
end;
@@ -6924,7 +6916,6 @@ begin
if output.sw is StreamWriter then
writeln_in_output
else CurrentIOSystem.Writeln;
- PrintState := 0;
end;
procedure Writeln(params args: array of object);
@@ -6941,7 +6932,6 @@ begin
CurrentIOSystem.Write(args[i]);
CurrentIOSystem.Writeln;
end;
- PrintState := 0;
end;
procedure Write(f: Text);
@@ -6956,6 +6946,19 @@ begin
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
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;
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));
f.sw.WriteLine;
- f.PrintState := 0;
end;
procedure Writeln(f: Text; val: object);
@@ -7018,28 +7020,14 @@ end;
procedure Print(s: string);
begin
if PrintDelimDefault<>'' then
- begin
- if PrintState = 0 then
- begin
- Write(s);
- PrintState := 1
- end
- else Write(PrintDelimDefault, s)
- end
+ Write(s, PrintDelimDefault)
else Write(s)
end;
procedure Print(o: object);
begin
if PrintDelimDefault<>'' then
- begin
- if PrintState = 0 then
- begin
- Write(o);
- PrintState := 1
- end
- else Write(PrintDelimDefault, o)
- end
+ Write(o, PrintDelimDefault)
else
Write(o)
end;
@@ -7048,37 +7036,27 @@ procedure Print(params args: array of object);
begin
if args.Length = 0 then
exit;
- {if PrintDelimDefault<>'' then
+ if PrintDelimDefault<>'' then
for var i := 0 to args.length - 1 do
Write(args[i], PrintDelimDefault)
else
for var i := 0 to args.length - 1 do
- Write(args[i])}
- for var i := 0 to args.Length - 1 do
- Print(args[i])
+ Write(args[i])
end;
procedure Println(params args: array of object);
begin
Print(args);
Writeln;
- PrintState := 0;
end;
-var FilePrintState := 0;// Хранить FilePrintState в типе Text!!!
-
procedure Print(f: Text; params args: array of object);
begin
if args.Length = 0 then
exit;
if PrintDelimDefault<>'' then
for var i := 0 to args.length - 1 do
- if f.PrintState = 0 then
- begin
- Write(f, args[i]);
- f.PrintState := 1
- end
- else Write(f, PrintDelimDefault, args[i])
+ Write(f, args[i], PrintDelimDefault)
else
for var i := 0 to args.length - 1 do
Write(f, args[i])
@@ -7088,7 +7066,6 @@ procedure Println(f: Text; params args: array of object);
begin
Print(f, args);
Writeln(f);
- f.PrintState := 0;
end;
procedure Serialize(filename: string; obj: object);
@@ -7112,9 +7089,6 @@ end;
// -----------------------------------------------------
procedure Assign(f: Text; name: string);
begin
- f.PrintState := 0;
- if f = input then
- PrintState := 0;
try
f.fi := System.IO.FileInfo.Create(name);
except
@@ -7137,7 +7111,6 @@ procedure AssignFile(f: Text; name: string) := Assign(f, name);
procedure Close(f: Text);
begin
- f.PrintState := 0;
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sr <> nil then
@@ -7165,7 +7138,6 @@ procedure Reset(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
if f.sr = nil then
begin
f.sr := new StreamReader(f.fi.FullName, en);
@@ -7206,7 +7178,6 @@ procedure Rewrite(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
if f.sw = nil then
begin
f.sw := new StreamWriter(f.fi.FullName, False, en);
@@ -7240,7 +7211,6 @@ procedure Append(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
f.sw := new StreamWriter(f.fi.FullName, True, en);
end;
@@ -14180,7 +14150,6 @@ begin
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
__FixPointer(nil);
StartTime := DateTime.Now;
- PrintState := 0;
end;
procedure __InitModule__;
@@ -14200,7 +14169,6 @@ end;
procedure __FinalizeModule__;
begin
- PrintState := 0;
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
output.sw.Close;
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
diff --git a/bin/Lib/ABCDatabases.pas b/bin/Lib/ABCDatabases.pas
index 82e25bc30..f821886b6 100644
--- a/bin/Lib/ABCDatabases.pas
+++ b/bin/Lib/ABCDatabases.pas
@@ -80,6 +80,8 @@ type
[PrintAttribute(' ', 4, -5)]
property УчитсяВКШ: boolean read _inSunSchool;
end;}
+
+ ///!#
Ученик = auto class
Фамилия: string;
Класс, Рост: integer;
diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas
index d87755dd6..4d5638e20 100644
--- a/bin/Lib/PABCSystem.pas
+++ b/bin/Lib/PABCSystem.pas
@@ -379,7 +379,6 @@ type
fi: FileInfo;
sr: StreamReader;
sw: TextWriter;
- PrintState: integer := 0; // 0 - до любого вывода и в начале строки
public
/// Возвращает значение типа 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 Print(a,b,...);
-/// Выводит значения a,b,... на экран, разделяя их пробелами
+/// Выводит значения a,b,... на экран, после каждого значения выводит пробел
procedure Print(o: object);
///--
procedure Print(s: string);
///--
procedure Print(params args: array of object);
///- procedure Print(f: Text; a,b,...);
-/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами
+/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел
procedure Print(f: Text; params args: array of object);
///- procedure Println(a,b,...);
-/// Выводит значения a,b,... на экран, разделяя их пробелами, и переходит на новую строку
+/// Выводит значения a,b,... на экран, после каждого значения выводит пробел и переходит на новую строку
procedure Println(params args: array of object);
///- procedure Println(f: Text; a,b,...);
-/// Выводит значения a,b,... в текстовый файл f, разделяя их пробелами, и переходит на новую строку
+/// Выводит значения a,b,... в текстовый файл f, после каждого значения выводит пробел и переходит на новую строку
procedure Println(f: Text; params args: array of object);
/// Сериализует объект в файл (объект должен иметь атрибут [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);
begin
- PABCSystem.Print(Self,o);
- {if PrintDelimDefault<>'' then
+ if PrintDelimDefault<>'' then
foreach var s in o do
PABCSystem.Write(Self, s, PrintDelimDefault)
else
foreach var s in o do
- PABCSystem.Write(Self, s)}
+ PABCSystem.Write(Self, s)
end;
procedure Text.Println(params o: array of Object);
begin
- PABCSystem.Println(Self,o);
- {if o.Length <> 0 then
+ if o.Length <> 0 then
begin
if PrintDelimDefault<>'' then
for var i:=0 to o.Length-2 do
@@ -6593,7 +6590,7 @@ begin
PABCSystem.Write(Self, o[i]);
PABCSystem.Write(Self, o.Last);
end;
- PABCSystem.Writeln(Self);}
+ PABCSystem.Writeln(Self);
end;
function Text.Eof := PABCSystem.Eof(Self);
@@ -6817,7 +6814,7 @@ begin
end;
// -----------------------------------------------------
-// PointerOutput # PointerOutput subroutines
+// Write - Writeln # Write subroutines
// -----------------------------------------------------
function PointerOutput.ToString: string;
begin
@@ -6829,11 +6826,6 @@ begin
p := ptr;
end;
-// -----------------------------------------------------
-// Write - Writeln # Write subroutines
-// -----------------------------------------------------
-var PrintState := 0; // 0 в начале строки; 1 - после вывода без перехода на новую строку
-
procedure Write;
begin
end;
@@ -6924,7 +6916,6 @@ begin
if output.sw is StreamWriter then
writeln_in_output
else CurrentIOSystem.Writeln;
- PrintState := 0;
end;
procedure Writeln(params args: array of object);
@@ -6941,7 +6932,6 @@ begin
CurrentIOSystem.Write(args[i]);
CurrentIOSystem.Writeln;
end;
- PrintState := 0;
end;
procedure Write(f: Text);
@@ -6956,6 +6946,19 @@ begin
raise new System.IO.IOException(GetTranslation(FILE_NOT_OPENED_FOR_WRITING));
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;
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));
f.sw.WriteLine;
- f.PrintState := 0;
end;
procedure Writeln(f: Text; val: object);
@@ -7018,28 +7020,14 @@ end;
procedure Print(s: string);
begin
if PrintDelimDefault<>'' then
- begin
- if PrintState = 0 then
- begin
- Write(s);
- PrintState := 1
- end
- else Write(PrintDelimDefault, s)
- end
+ Write(s, PrintDelimDefault)
else Write(s)
end;
procedure Print(o: object);
begin
if PrintDelimDefault<>'' then
- begin
- if PrintState = 0 then
- begin
- Write(o);
- PrintState := 1
- end
- else Write(PrintDelimDefault, o)
- end
+ Write(o, PrintDelimDefault)
else
Write(o)
end;
@@ -7048,37 +7036,27 @@ procedure Print(params args: array of object);
begin
if args.Length = 0 then
exit;
- {if PrintDelimDefault<>'' then
+ if PrintDelimDefault<>'' then
for var i := 0 to args.length - 1 do
Write(args[i], PrintDelimDefault)
else
for var i := 0 to args.length - 1 do
- Write(args[i])}
- for var i := 0 to args.Length - 1 do
- Print(args[i])
+ Write(args[i])
end;
procedure Println(params args: array of object);
begin
Print(args);
Writeln;
- PrintState := 0;
end;
-var FilePrintState := 0;// Хранить FilePrintState в типе Text!!!
-
procedure Print(f: Text; params args: array of object);
begin
if args.Length = 0 then
exit;
if PrintDelimDefault<>'' then
for var i := 0 to args.length - 1 do
- if f.PrintState = 0 then
- begin
- Write(f, args[i]);
- f.PrintState := 1
- end
- else Write(f, PrintDelimDefault, args[i])
+ Write(f, args[i], PrintDelimDefault)
else
for var i := 0 to args.length - 1 do
Write(f, args[i])
@@ -7088,7 +7066,6 @@ procedure Println(f: Text; params args: array of object);
begin
Print(f, args);
Writeln(f);
- f.PrintState := 0;
end;
procedure Serialize(filename: string; obj: object);
@@ -7112,9 +7089,6 @@ end;
// -----------------------------------------------------
procedure Assign(f: Text; name: string);
begin
- f.PrintState := 0;
- if f = input then
- PrintState := 0;
try
f.fi := System.IO.FileInfo.Create(name);
except
@@ -7137,7 +7111,6 @@ procedure AssignFile(f: Text; name: string) := Assign(f, name);
procedure Close(f: Text);
begin
- f.PrintState := 0;
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
if f.sr <> nil then
@@ -7165,7 +7138,6 @@ procedure Reset(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
if f.sr = nil then
begin
f.sr := new StreamReader(f.fi.FullName, en);
@@ -7206,7 +7178,6 @@ procedure Rewrite(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
if f.sw = nil then
begin
f.sw := new StreamWriter(f.fi.FullName, False, en);
@@ -7240,7 +7211,6 @@ procedure Append(f: Text; en: Encoding);
begin
if f.fi = nil then
raise new IOException(GetTranslation(FILE_NOT_ASSIGNED));
- f.PrintState := 0;
f.sw := new StreamWriter(f.fi.FullName, True, en);
end;
@@ -14180,7 +14150,6 @@ begin
(listener as System.Diagnostics.DefaultTraceListener).AssertUiEnabled := true; }
__FixPointer(nil);
StartTime := DateTime.Now;
- PrintState := 0;
end;
procedure __InitModule__;
@@ -14200,7 +14169,6 @@ end;
procedure __FinalizeModule__;
begin
- PrintState := 0;
if (output.sw <> nil) and (output.sw is StreamWriter) and ((output.sw as StreamWriter).BaseStream <> nil) then
output.sw.Close;
if (ErrOutput.sw <> nil) and (ErrOutput.sw is StreamWriter) and ((ErrOutput.sw as StreamWriter).BaseStream <> nil) then
diff --git a/bin/PascalABCNET.chm b/bin/PascalABCNET.chm
index ca9f8386c..3e93a9bc4 100644
Binary files a/bin/PascalABCNET.chm and b/bin/PascalABCNET.chm differ
diff --git a/bin/PascalABCNET.chw b/bin/PascalABCNET.chw
index cd01dc12e..8972621d1 100644
Binary files a/bin/PascalABCNET.chw and b/bin/PascalABCNET.chw differ
|