Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!murtoa.cs.mu.oz.au!munnari.oz.au!uniwa!vaxa!a_dent From: a_dent@vaxa.uwa.oz (ANDY DENT, PH: 09 380 2620) Newsgroups: comp.sys.mac.programmer Subject: LSP v2 compile error - string func Message-ID: <342@vaxa.uwa.oz> Date: 20 Jun 89 02:38:35 GMT Organization: University of Western Australia Lines: 35 The following is a copy of a unit declaration that reliably gets a compile error for the implementation portion saying that "the type of the function result doesn't match the earlier declaratation" which is funny because one is copied from the other. What is even funnier is that there are no problems if the result is declared as str255. I though that the LSP "string" type was a synonym for str255? Note, this happens in v2.01 as well as v2.0. ---------- buggy unit starts here -------------- unit bugINLSP; { reliably gets error when compiling: } { Result type doesn't match previous declaration } { No problems using routine in main program, just can't declare as } { shown here - in a nice tidy unit. } { The funny thing is, no problems if I declare function as Str255 type } { instead of String !!!! } interface const BufferSize = 2048; { 2kb } type ioBuffer = packed array[1..BufferSize] of char; ioReadBuffer = record len, pos: longint; data: ioBuffer; end; function stringFromBuffer (var Rbuf: ioReadBuffer; var empty: boolean): string; implementation function stringFromBuffer (var Rbuf: ioReadBuffer; var empty: boolean): string; begin end; { stringFromBuffer } end.