On 27 May 2006, at 09:46, Arne Hanssen wrote:
setlength(last3, 3);
last3[1]:= filename[length(filename)-2];
last3[2]:= filename[length(filename)-1];
last3[3]:= filename[length(filename)];
As already explained, you must tell 'last3' its length. As you
already
are using a somewhat "lowlevel" approach, you could replace the state-
ment 'setlength(last3, 3);' with 'last3[0]:=chr(3);'.
Note that the setlength will generate exactly the same code as the
'last3[0]:=chr(3);' statement, so it's better to keep the setlength
(in case the string would ever become an ansistring, or just for
readability)
Jonas
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal