[fpc-pascal]absolute identifier

Jonas Maebe jonas at zeus.rug.ac.be
Wed Apr 10 21:20:29 CEST 2002


On woensdag, april 10, 2002, at 09:09 , ron wilson wrote:

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

Just use "str := buf;", that should also work (even for shortstrings) 
and will take care of setting the length for you (as long as there 
aren't any #0 characters in that array).


Jonas





More information about the fpc-pascal mailing list