stringslib strcat2

Discuss about beta versions of mikroPascal compiler.
Post Reply
Author
Message
janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

stringslib strcat2

#1 Post by janni » 11 Oct 2007 14:21

I've 'reinvented' strcat2 just to see how the compiler works with string constants in expressions like txt:=txt+'abc' (BTW could I get the fixed strigslib?) and I have to say that I do not like it. It produces a lot of code and increases the RAM use unnecessarily.

Wouldn't it be better to handle such strings as actual string constants are handled, i.e place them in ROM and use a procedure contatenating string variable with constant string? This could also add a possibility to use instructions like:

var txt:string[10];
const cst='abc';

strcat(txt,cst);

Compiler could easily decide whether to use a 'standard' strcat routine, or one handling string constants.

Post Reply

Return to “mikroPascal Beta testing”