[fpc-pascal]Incorrect RT 216 error?

Ingmar Tulva juss_it at ut.ee
Sat Feb 16 13:40:52 CET 2002


On Fri, 15 Feb 2002, Jonas Maebe wrote:

}Now, how should you do it then? One way is:
}
}> If I use concat instead it works, but it's *much* slower:
}>
}> string := concat (string, block [block_index]);
}
}In this case, the concat helper makes sure enough memory gets allocated
}for the anistring before anything is inserted. Of course, doing this for
}every character makes it very slow as you have found out.
}
}Another way is to use the setlength() procedure, with which you can create
}an empty ansistring with enough room for a specified amount of characters.
}Please read the manual for more information about ansistrings.

As I recall, ansistrings start with index 0, not 1 (like shortstrings
do). Then this is to be corrected, too. Not sure, though, I always start
my files with {$H-}.

--------
Ingmar Tulva





More information about the fpc-pascal mailing list