string problems

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
salex319
Posts: 72
Joined: 28 Nov 2013 01:17

string problems

#1 Post by salex319 » 07 Jun 2016 00:43

Running MikroPascal PRO for PIC 6.6.3

I had to change the following line:

Code: Select all

 ostr:='$'+strOurNodeID+'9'+chr(Seq)+'10'+MakeReply+#13;
to:

Code: Select all

             ostr:=MakeReply;
             ostr:='$'+strOurNodeID+'9'+chr(Seq)+'10'+ostr+#13;
to produce the correct output. Before the change the function simply left out the result from the MakeReply function.

I also had to add the #0 to the end of the following line to get the string properly terminated.

Code: Select all

              RplyStr:=RplyStr + DEVTYPE + VERSION + HWCONFIG + #0;
These are bugs I believe or am I mistaken.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: string problems

#2 Post by janni » 07 Jun 2016 02:29

salex319 wrote:These are bugs I believe or am I mistaken.
The second one certainly is and persists since at least v. 6.40 of mP PRO :( .

The first one may be a limitation rather than a bug - depending on the way the function was defined. Still, it's true that concatenating strings with the '+' operator is not well implemented and it's safer to use functions like strcat for this purpose.

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: string problems

#3 Post by lana.arsic » 08 Jun 2016 16:11

Hi,

Can you please attach your project in a zip/rar archive, so I could test it?

Best regards,
Lana

salex319
Posts: 72
Joined: 28 Nov 2013 01:17

Re: string problems

#4 Post by salex319 » 10 Jun 2016 17:28

Thanks for the offer to investigate. I don't have the exact code configuration that exhibited the issue and I don't have the time to go back and try to reproduce it. I will be more careful to save the code next time I see this. Thank you.

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: string problems

#5 Post by lana.arsic » 14 Jun 2016 08:10

Hi,

You're welcome. If that issue occurs again,
please send whole code at support[att]mikroe[dot]com.

Best regards,
Lana

Post Reply

Return to “mikroPascal PRO for PIC General”