IIF function

edited 8:24PM 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 8:24PM
    IIF function doesn't declared in FS. You must declare it in FS
  • edited 8:24PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.