THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/04/2008 at 15:20, xxxxxxxx wrote:
Howdy,
It totally fails on the intel Mac.
Actually, the only place it works properly is on the G4 PPC Mac and on the PC in R9. R10 on the PC is giving me the wrong result.
If I have a value of 0.254 already in the dialog's edit number field, and I type in at the end of that "+1", and hit tab or enter, the result should be 1.254.
But these are the test results:
G4 Mac running R9.1 - result = 1.254
G4 Mac running R9.5 - result = 1.254
G4 Mac running R9.6 - result = 1.254
G4 Mac running R10.5 demo - result = 1.077
PC running R9.1 - result = 1.254
PC running R10.1 - result = 1.077
Intel Mac running R9.6 - result = 125.4
Intel Mac running R10.1 - result = 78.419
OK, first in the GeDialog::Command() function I have this:
> case MY_EDITNUMBER: \> GetString(MY_EDITNUMBER,str); \> val = ParseString(str); \> SetReal(MY_EDITNUMBER,val); \> SetString(MY_EDITNUMBER,RealToString(val)+uStr);
My parser function receives the string and first strips all of the letter characters from the string (A-Z and a-z) and then parses the remaining string. It seemed like the letter characters were interfering with the parser's result.
Then I have a print statement after the parser evaluates the string in my ParseString() function to print out the result:
> GePrint("String = "+expression+" = "+RealToString(rVal));
On the G4 Mac and PC in R9.1 it prints:
String = 0.254+1 = 1.254
Which is correct. 
On the G4 Mac and the PC in R10 it prints:
String = 1.077 = 1.077
it looks like Cinema parsed the string before it got to my parsing function, I'm assuming it parsed it before the GeDialog::Command() function. :o(
On the intel Mac in R9.6 it prints:
String = 0.254+1 = 1.254
Which is correct, BUT the output to the dialog is 125.4 :o(
On the intel Mac in R10 it prints:
String = 78.419 = 78.419
Again, it looks like Cinema parsed the string before it got to my parsing function. :o(
The Parser class in both R9 and R10 SDK's are identical. So, needless to say, I just may go back to the "no unit display" in the number edit field. :o(
Trying to get the unit string into the number edit field is becoming too much of a hack, and I'd much prefer proper functionality for the plugin.
Thanks anyway.
Adios,
Cactus Dan