Environment
Windows 2012r2
Scriptcase 9.4.016
PHP 7
I have a grid application with some code in the onRecord event that when I attempted to execute, I received an error.
Code:
if ({decision}==‘AA’) {++[aacnt];} else {[aacnt]=0;}
Error:
“Parse error: syntax error, unexpected ‘else’ (T_ELSE) in …”
When I looked at the line number of the Generated code I saw:
“if ($this->decision ==‘AA’) else”
I figured maybe I had a syntax error causing the half generated code. So I reformatted my code as follows to make it clearer to read.
if ({decision}==‘AA’) {
++[aacnt];
} else {
[aacnt]=0;
}
I could not see any issues so when I executed the application again with the reformatted code, the error went away. My only guess is that there is a bug with the code generator or am I missing something as to why code can’t be formatted as my first attempt? This is not a show stopper but I thought that it would be could to put it out here just in case it’s a bug.