[fpc-pascal]Incorrect RT 216 error?

James_Wilson at i2.com James_Wilson at i2.com
Thu Feb 14 21:19:46 CET 2002

I'm getting an RT 216 error in a spot that seems it shouldn't be 
occurring, but it may just be me...

I'm using FPC 1.1 dated 2001/06/19. The target is Win32, running on 
Windows 2000 Professional. I've included a small sample, so you can see 
what I'm referring to.

The error occurs when I attempt to add a character to a string. Basically, 
I'm rewriting a program that uses readln to get data from a file. Some of 
the files are quite large, so I'd rather use blockread (which is faster). 
I read a block from the file, then scan the block starting from the first 
position. As the block is being scanned any character other then #10 and 
#13 (RETURN and LINEFEED) are ignored, while the rest are appended to a 
string variable. But I get the RT 216 on line 82 (according to -gl) when I 
try something like this:

string [string_index] := block [block_index];

If I use concat instead it works, but it's *much* slower:

string := concat (string, block [block_index]);

Now, in order to make certain that the string is empty before each 
iteration I use string := '' (an empty string, which is on line 73 of the 
attached file). Interestingly, if I change that line to string := ' ' 
(that's a single space between the quotes) I no longer get a 216 error, 
but all the strings display on the screen are just a single, seemingly 
random, character. Sigh...

This seems like an FPC bug, but knowing me it's something I'm doing wrong. 
Maybe trying to "clear" a string using string := '' is wrong, but I don't 
recall that being a problem before.

Anyway, TIA for any help you can give me.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20020214/14b5f236/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/octet-stream
Size: 2476 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20020214/14b5f236/attachment.obj>

More information about the fpc-pascal mailing list