[fpc-pascal]absolute identifier

ron wilson ron.wilson at coastgames.com
Thu Apr 11 15:46:03 CEST 2002


you are correct.  the type cast works very well.

in my case, however, i do need the setlength, because i don't clear the
buffer when i re-use it, i just set buflen:=0. so i have to set the length
if the buffer has garbage data beyond the current buflen.

ron wilson


-----Original Message-----
From: fpc-pascal-admin at deadlock.et.tudelft.nl
[mailto:fpc-pascal-admin at deadlock.et.tudelft.nl]On Behalf Of Florian
Klaempfl
Sent: Thursday, April 11, 2002 5:42 AM
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: RE: [fpc-pascal]absolute identifier


At 14:54 10.04.02 -0500, you wrote:
>thanks - ill do that instead.  btw the code i posted works afiak.

Yes, it should and you don't need the setlength because the type
cast code does the job for you.

 > how about for type casting?
 >
 >   var
 >     buf: array[1..255] of char;
 >     buflen: byte;
 >     str: ansistring;
 >   ...
 >   str:=ansistring(buf);
 >   setlength(str,buflen);



_______________________________________________
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