Page 1 of 1

PostPosted: Fri Jun 10, 2005 7:32 am
by Vigon
I tried to use alertc() in diferent programs,
but the behavior is very strange because the string message field shows corrupted messages depending the size or format of the message.
Example code:
Code: Select all
//Testing alertc()with PDE version 7.0.0

main()   {
string TestString="";
graph_on() ;

   if(alertc("Modbus Commands" ,
      "Sent: " + TestString +
      "\nTime-Out: " + TestString +
      "\nCRC: " + TestString ,
      "OK:Clear", 0))TestString="";
   TestString= TestString +"0"; //increasing the size of TestString.


apreciate any help :)

PostPosted: Tue Jun 14, 2005 3:33 am
by dewey
This is a PocketC bug where it is releasing the string's memory before drawing the custom alert. Sometimes this memory is being overwritten before the alert is drawn.

To workaround this until a fix is released store the text of the alert in a variable - this will cause the string remain undeleted while the alert is active.

string text;
text = "Sent: " + TestString....

alertc("Modbus Commands", text, "OK:Clear", 0);