Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-02

TReader Class

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Justin Smyth

Hopefully someone can point me to the right direction here, if this isnt the right place to ask feel free to point to where i can ask ...

The FPC Class for TReader is missing some procedures as defined in the delphi class of the same name

writestr , readstr , writevalue and readvalue.

is there something else that i could use which would do the job ? i dont want to create a inhertied class on TReader and add the missing bits because certian functions need to be of TReader Not T<MyCustom>Reader ie Filer.DefineProperty which has param as TReaderProc & TWriterProc which both point to TReaderProc = procedure(Reader: TReader) of object & TWriterProc = procedure(Writer: TWriter) of object; which are defined in classesh.inc which is part of the RTL )

if i am to add this to the RTL Definition of TReader i'd need to recompile the source to FPC ( which i have ) but not sure how i do this.

Justin Smyth

Reply by email

Unknown author
to Justin Smyth

Just interested in this...
can you not use writestring, readstring?
i know code is different but even on delphi they suggest you use writestring and readstring.
readvalue is published.
writevalue is not published... since you supposedly should be using existing routines to write values.

if you have a user-defined type then perhaps your own extension using writebinary with a pre-code.

--- dale

Justin Smyth wrote 24 lines
Hopefully someone can point me to the right direction here, if this isnt the right place to ask feel free to point to where i can ask ... The FPC Class for TReader is missing some procedures as defined in the delphi class of the same name writestr , readstr , writevalue and readvalue. is there something else that i could use which would do the job ? i dont want to create a inhertied class on TReader and add the missing bits because certian functions need to be of TReader Not T<MyCustom>Reader ie Filer.DefineProperty which has param as TReaderProc & TWriterProc which both point to TReaderProc = procedure(Reader: TReader) of object & TWriterProc = procedure(Writer: TWriter) of object; which are defined in classesh.inc which is part of the RTL ) if i am to add this to the RTL Definition of TReader i'd need to recompile the source to FPC ( which i have ) but not sure how i do this. Justin Smyth

Reply by email

Michael Van Canneyt
to Justin Smyth: Hopefully someone can point me to the right direction here, if this isnt the right place…
Justin Smyth wrote 6 lines
Hopefully someone can point me to the right direction here, if this isnt the right place to ask feel free to point to where i can ask ... The FPC Class for TReader is missing some procedures as defined in the delphi class of the same name writestr , readstr , writevalue and readvalue.

? Why would you need writestr in a reader ?

Secondly, if I look at TReader, I see:

     function ReadString: string;
     function ReadWideString: WideString;
     function ReadUnicodeString: UnicodeString;
     function ReadValue: TValueType;

So what is the definition of your missing read calls ?

Michael.

Reply by email