IIF function

edited 11:42PM in FastScript
I'm currently using FastScript version witch comes with FastReport 4 Standard Edition v4.10.8. RAD Studio 2010.

Script sample (I'm using C++Script, but I have tested also PascalScript - same issue):
wrote:
{
String a = iif(true, "T", "F");
ShowMessage(a);
}
If this script is put inside a report - all OK, message shows "T".
But if executing inside the TfsScript object, message shows "0".
At this point it's not a big deal, cause IIF() function can simply be replaced by if..then..else statement.
But real problem starts with expression evaluation: TfsScript.Evaluate(), where IIF is the only way to define conditions.

Is it a bug, or I'm doing something wrong?

Comments

  • gpigpi
    edited 11:42PM
    IIF function doesn't declared in FS. You must declare it in FS
  • edited 11:42PM
    gpi wrote: »
    IIF function doesn't declared in FS. You must declare it in FS
    No, it IS. If function isn't declared, "Undeclared identifier" error raises when trying to call it. I have also tried to redeclare this function using TfsScript.AddMethod(), but this doesn't work - script ignores my method handler and just calls native IIF function, which is buggy.
    As a temporary workaround I've declared function with name IIF2, which does the same thing that IIF should. But it confuses end users.

Leave a Comment