03-18-2013 04:48 PM
Here is a strange problem…esp. since this is the last stage in competing my app and this problem cropped up during field testing.... Depending on the format of the %float, the result2(below) is blue or black… the key is in the number of decimals requested…
Values are double.. then converted to a float… simple arithmetic, here..
..the problem goes away if result2 is printed as %8.3f…else %8.4 and %10.4 produce a BLUE output of 307.9890 …hmmmmm…gremlins…???? Here is the offending code…
result = float(p/u);
sprintf(myline,"->[#%3.0d]\n $%8.3f for %8.3f \n$%8.4f or %8.4f \n\n",entryline,p,u,result,result2);
// let us see what it looks like... in various formats..
sprintf(myline," scan...% 8.3f %8.4f %10.3f %10.4f",result2,result2,result2,result2);
fprintf(stderr," scan...% 8.3f %8.4f %10.3f %10.4f",result2,result2,result2,result2);
displayIt(); yes… black .. blue… black .. blue…in the textarea and
stderr on console looks like this…
scan... 307.989 307.9890 307.989 307.9890
%10.4f also generates a BLUE number result if the result2 is in the range inclusive 200-999…
Here are the lines leading up to it….. should toUtf8 be toAscii ???? no effect!!
The eventual fate of thisline is to be written to a textArea in a function elsewhere..the line is included here for reference.. is there a memory leak???
Solved! Go to Solution.
03-18-2013 05:31 PM
03-18-2013 07:16 PM
Peter.. thank you for your quick, and accurate, response. Indeed, if I tap the number, it does try to dial... THANK YOU... I have had this dev alpha for almost 2 weeks, and I am programming in C++ to access Cascades contols/widgets.... It has been a steep learning curve esp. wrt QT... I will have to find the property to turn off this "feature".... unless I make this a "dial someone randomly in the world" app...errrr, no..not a good idea,eh.... do you know off hand what the property is.... by the way, am i niaive in assuming that "native app" means "written in C++"???? I seem to have heard that comment at the Waterloo BB Jam in Sept.... cheers, rich clausi, waterloo
03-18-2013 08:07 PM
03-18-2013 08:43 PM
Thank You, Peter, for the solution, and redirection of the posting.... by the way, i decided that i do not need 4 decimals so since 3 keeps the interface from thinking it is a telephone number, I am a happy camper... I would NEVER have figured that dialer bit out...cheers, rich