[fpc-pascal]absolute identifier

ron wilson ron.wilson at coastgames.com
Wed Apr 10 21:45:14 CEST 2002


it does work.  i am using it right now.  according to the documentation on
ansistrings (i actually read them) typecasting is designed to do this...  i
could be wrong i guess.

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 Carlo Kok
Sent: Wednesday, April 10, 2002 2:16 PM
To: fpc-pascal at deadlock.et.tudelft.nl
Subject: Re: [fpc-pascal]absolute identifier



----- Original Message -----
From: "ron wilson" <ron.wilson at coastgames.com>
To: <fpc-pascal at deadlock.et.tudelft.nl>
Sent: Wednesday, April 10, 2002 9:09 PM
Subject: RE: [fpc-pascal]absolute identifier


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

That should not work.

Better do something like:
 SetLength(Str, BufLen);
 Move(Buf, Str[1], BufLen);
  or
  SetString(Str, Pchar(@Buf), 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