From d3ff637f6e38b1075a5710f3f5e4a3d01532f681 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 12 May 2017 22:54:44 +0000 Subject: [PATCH] examples: fixed pascalstream with FPC 3.0+ git-svn-id: trunk@54891 - --- examples/pascalstream/PascalStream1.lpi | 9 ++------- examples/pascalstream/componentstreampas.pas | 13 ++++++++++++- examples/pascalstream/unit1.pas | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/examples/pascalstream/PascalStream1.lpi b/examples/pascalstream/PascalStream1.lpi index c996f8ff51..87b649acdf 100644 --- a/examples/pascalstream/PascalStream1.lpi +++ b/examples/pascalstream/PascalStream1.lpi @@ -1,7 +1,7 @@ - + - + @@ -14,7 +14,6 @@ - @@ -43,7 +42,6 @@ - @@ -66,9 +64,6 @@ - - - diff --git a/examples/pascalstream/componentstreampas.pas b/examples/pascalstream/componentstreampas.pas index 93bb038335..23d00cbacc 100644 --- a/examples/pascalstream/componentstreampas.pas +++ b/examples/pascalstream/componentstreampas.pas @@ -92,6 +92,9 @@ type procedure WriteBoolean(Value: Boolean); override; // procedure WriteChar(Value: Char); procedure WriteFloat(const Value: Extended); override; + {$IF FPC_FULLVERSION >= 30000} + procedure WriteSignature; override; + {$ENDIF} procedure WriteSingle(const Value: Single); override; procedure WriteCurrency(const Value: Currency); override; procedure WriteDate(const Value: TDateTime); override; @@ -236,6 +239,7 @@ var i: Integer; InString: Boolean; begin + Result:=''; InString:=false; for i:=1 to length(s) do begin case s[i] of @@ -363,6 +367,13 @@ begin WritePropertyAssignment(FloatToStr(Value)); end; +{$IF FPC_FULLVERSION >= 30000} +procedure TPASObjectWriter.WriteSignature; +begin + +end; +{$ENDIF} + procedure TPASObjectWriter.WriteSingle(const Value: Single); begin WritePropertyAssignment(FloatToStr(Value)); @@ -430,7 +441,7 @@ end; procedure TPASObjectWriter.WriteUnicodeString(const Value: UnicodeString); // save unicodestrings as utf8 begin - WritePropertyAssignment(StringToConstant(Value)); + WritePropertyAssignment(StringToConstant(String(Value))); end; procedure TPASObjectWriter.WriteVariant(const VarValue: Variant); diff --git a/examples/pascalstream/unit1.pas b/examples/pascalstream/unit1.pas index e5a0f37e81..59fd69f506 100644 --- a/examples/pascalstream/unit1.pas +++ b/examples/pascalstream/unit1.pas @@ -99,7 +99,7 @@ type procedure WriteComponents; procedure ReadComponents; - procedure OnFindComponentClass(Reader: TReader; const AClassName: string; + procedure OnFindComponentClass({%H-}Reader: TReader; const AClassName: string; var ComponentClass: TComponentClass); property Filename: string read FFilename write SetFilename; end;