Hi,
When pasting a long formula with syntax error into my UltraCalcManager, the application crashes. In order to reproduce the issue, a similiar formula to the below can be used:
IF(MONTH([[T_TRADEDATE]]) = 1, "(01) January",IF(MONTH([[T_TRADEDATE]]) = 2, "(02) February",IF(MONTH([[T_TRADEDATE]]) = 3, "(03) March",IF(MONTH([[T_TRADEDATE]]) = 4, "(04) April",IF(MONTH([[T_TRADEDATE]]) = 5, "(05) May",IF(MONTH([[T_TRADEDATE]]) = 6, "(06) June",IF(MONTH([[T_TRADEDATE]]) = 7, "(07) July",IF(MONTH([[T_TRADEDATE]]) = 8, "(08) August",IF(MONTH([[T_TRADEDATE]]) = 9, "(09) September",IF(MONTH([[T_TRADEDATE]]) = 10, "(10) October",IF(MONTH([[T_TRADEDATE]]) = 11, "(11) November",IF(MONTH([[T_TRADEDATE]]) = 12, "(12) December",”ERROR”))))))))))))
If I replace " with ', there is no syntax error and the application works good. I have tried debugging this and my thoughts are that, somehow, maybe due to all the syntax errors, the code is stuck in the recursive function that compiles the formula.
Any ideas why could this happen?
Thank you
Hi Hector,
I tried this out, as well, and I am unable to duplicate the crash. I do get an error indicating that the formula failed to parse because of an unexpected character (the quote), but no crash. I copied the formula from the text you posted here and pasted it directly into the FormulaBuilder. So I suppose it's possible that the character code got changed or the text encoded somewhere along the way.
Out of curiosity, if you copy and paste the formula from here on the forum into the FormulaBuilder and then try again, does it still crash?
Either way, there's not much we can do if we cannot duplicate the issue. So if you could post a small sample project demonstrating the crash, we would really like to be able to look into this and get it fixed.
Hi Sahaja,
When I say "my application crashes" I mean that the application is unexpectedly closed, with no exceptions in our logs and anything, so all windows forms are closed. I can't see the attached image as it is too small and it is loosing quality while I zoom.
I have tried with the below formula and it is crashing the app too (without using the workaround), so please, try using this exact formula:
IF(1 = 1, "(01) January",IF(2 = 2, "(02) February",IF(3 = 3, "(03) March",IF(4 = 4, "(04) April",IF(5 = 5, "(05) May",IF(6 = 6, "(06) June",IF(7 = 7, "(07) July",IF(8 = 8, "(08) August",IF(9 = 9, "(09) September",IF(10 = 10, "(10) October",IF(11 = 11, "(11) November",IF(12 = 12, "(12) December",”ERROR”))))))))))))
Note that this is failing due to the quotes enclosing ERROR are not regular quotes. If you replace them by single or regular double quotes it will work fine.
Regards.
I tried to reproduce this issue and I used a similar formula in my sample application. I got a syntax error saying it couldn’t compile the formula but my application did not crash. We are glad you were able to find a work around for this issue but we would like to identify the root cause. Can you please provide us additional details? When you are saying your application crashed, is it your designer that’s crashing? or is it your Winforms application that’s crashing?
Sincerely,
Sahaja Kokkalagadda
Associate Software Developer, Windows Forms
http://ko.infragistics.com/
Finally, we have found the solution: The problem seems to be locate in a function that performs formula parsing, it keeps trying to parse a token indefinitely once an error has been thrown. Proposed solution is to avoid processing the same token several times.
In this case the problematic token is the double quote for ERROR, which are not the regular ones.