v4.80 bèta String concat problem using '+' (OK, my fault)

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

v4.80 bèta String concat problem using '+' (OK, my fault)

#1 Post by Dany » 15 Jun 2011 12:13

Please ignore this post. It was entirely my fault. I oversaw that " StrCat(S1, S2);" made S1 too long to be concatinated with S2 into S3. :oops: :oops: :oops: :oops: Soooo sorry!



Hi, in v4.80 bèta I have seen in the software debugger a string concat problem:
Testcode:

Code: Select all

Var S1, S2, S3: string[10];
...
  S1 := 'xxxxxxx';
  S2 := 'yyy';
  S3 := 'zzzz';
  
  StrCat(S1, S2);                 // Ok , result = 'xxxxxxxyyy' + ending 0
  
  S3 := '';
  S3 := S1 + S2;                  // wrong, result = 'xxxxxxxyyyy' (no ending zero, 4 times 'y')
                                  //      side-effect: S2 becomes 'yy' (1 character shorter)
                                  
  S3 := '';
  S3 := S1 + 'yy';                // wrong, result = 'xxxxxxxyyyy' (no ending zero, 4 times 'y')
                                  //      side-effect: S2 becomes 'y' (again 1 character shorter)
Also seen in mP PIC v4.80 bèta.

I can not really believe that above is true. Can someone confirm (or deny) this?

Thanks in advance.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: v4.80 bèta String concat problem using '+' (OK, my fault

#2 Post by Dany » 15 Jun 2011 18:18

Please ignore this post. It was entirely my fault. I oversaw that " StrCat(S1, S2);" made S1 too long to be concatinated with S2 into S3. :oops: :oops: :oops: :oops: Soooo sorry!

I am so happy that it is not something in the compiler, only one stupid me... :? :?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”