On 28 Feb 2005 at 15:14, Adriaan van Os wrote:
Another problem, also reported on the macpascal mailing list and reproduced by the following program:
[G5:gcc/p/test] adriaan% cat avo12.pas program avo12;
type Str255 = record sLength: Byte; sChars: packed array[1..255] of char; end;
function StringToStr255 ( const s: String ) = Result : Str255; begin Result.sLength := Min( Length( s ), 255 ); if Result.sLength > 0 then begin Result.sChars[1..Result.sLength] := s[1..Result.sLength]; end; end;
procedure DrawString1( const s: Str255); external name 'DrawString'; procedure DrawString2( protected var s: Str255); external name 'DrawString';
begin DrawString1( StringToStr255( 'Hello')); {OK} DrawString2( StringToStr255( 'Hello')) {Error: reference expected, value given} end.
[...]
Don't know much about EP - but I would have thought that the compiler is correct to reject the call to DrawString2. "Hello" is not a variable (protected or not).
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/