procedure Run_Command_Wait(TheCommand : string); cdecl;
This 'string' is of the type shortstring, and thus will truncate your
string to 255 characters.
Change it in ansistring or add {$H+} to the beginning of your program.

I would advice to declare "TheCommand : AnsiString" instead of changing the compiler switch because then it's independend from such changes/settings. Especially, when such switches change other things too and one day you may need some of these other things and get the side effect of changing the string type too.

In general I would advice not to use the generic types "string" (nor "integer") at all. It only leads to confusion because noone knows (or is aware) of what type is meant in particular. Why not use the strings that is needed?

Jürgen Hestermann.

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

Reply via email to