Under Linux using Lazarus 1.0.8/Fpc 2.6.2/Fedora 14 x64:

it seems like mixing Ansistrings and Pchars on certain run time functions is a real no-no.

I just spent HOURs, trying to see why I was not getting good program behavior.

Lesson #1: Never call function like Copy( pchar, start, length),

ONLY use Copy( ansistring/string, start, length)

Other functions like PosEx( ) do not generate compiler
errors but you really do NOT want a Pchar to this function,
only an ansistring/string.

Passing a Pchar gives weird, erratic behavior

Maybe the RTL library team could put compiler WARNINGS about only allowing for strings/ansistrings on copy( ), posex( ), and other functions who have really no business taking pchar arguments.

Cheers,

md

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to