L505 wrote: > I'm lacking some memory concept here. Below program doesn't work unless > setlengths > are called first on the shortstrings. > > 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);'. -- Vennlig hilsen / Best regards |\ ___,,--, _ Arne Hanssen, Senja, Norway /,`--'' \-,,__,'/ http://www.tuxic.net/ |,4 ) )_ ) /~-----' ---------------------------------'---^~(_/-_)--(_/_)------- _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal