Andrew Cameron wrote:
function getname: string; begin getname := 'somestring'; end; [...] I am using gpc version 2.0
Please upgrade to a more recent version such as gpc-19980830; see ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/. The error message comes from GPC's strings not being limited to a maximum of 255 chars. On a 32-bit platform, they can be up to 4GB long. For this reason, GPC cannot determine a reasonable default length for strings being returned as function results. While gpc-19980830 will compile your program (defaulting to 255, with a warning), it is better to avoid the problem by something like this: type mystring = string (255); function getname: mystring; begin getname := 'somestring'; end; Hope this helps, Peter -- Peter Gerwinski, Essen, Germany, http://home.pages.de/~Peter.Gerwinski/ Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-980830 PGP key on request - 6C 94 45 BE 28 A4 96 - 0E CC E9 12 47 25 82 75 Fight the SPAM and UBE! - http://spam.abuse.net/ - http://maps.vix.com/