[fpc-pascal] How to initialize a "Text" variable?

Sam Liddicott sam at liddicott.com
Mon Mar 17 08:33:22 CET 2008


Find the definition of the "text" type and see that it contains pointers to read and write functions.

They need replacing in yor instance to pointers to functions that do nothing.

The original Pascal file access is object oriented after all!

Sam


-----Original Message-----
From: Tomas Hajny <XHajT03 at mbox.vol.cz>
Sent: 17 March 2008 07:17
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Subject: Re: [fpc-pascal] How to initialize a "Text" variable?

On Sun, March 16, 2008 12:14, Felipe Monteiro de Carvalho wrote:
> On Sun, Mar 16, 2008 at 8:16 AM, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>>  Assign yyoutput to a dummy stream, which simply skips output.
>
> Could you explain better how can this be implemented?
>
> The only think I know about streams is TStream.

I'm not sure if mixing lexlib (which is AFAIK written using procedural TP
style code) with streams is a good idea. Depending on your platform, you
could probably simply assign the text file name of 'NUL' or '/dev/nul'.
Admittedly, I don't know whether this kind of device exists for all
platforms (e.g. Symbian ;-) ).

Tomas


_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list