Applies To:
  • CitectSCADA 5.xx

I have got a Cicode block in my RTF formatted report. I have also declared some Variables at the top of my report file as per the Help, but I get a compilation error "Error: Operand expected" What am I doing wrong? 

The V5.00 online help incorrectly states that Cicode variables can be declared from within a Cicode block in a Report. This is true only for plain reports and not RTF format reports. In a plain report, it is possible to declare variables globally by defining them in a Cicode block at the very start of the file. These variables can then be called from within any Cicode block throughout the report.

RTF format reports do not support the declaration of any variables. The reason this doesn't work in RTF is that the user's 'top of file' is not the same as the RTF file's. If you need to use variables in a Cicode block you can either: a) declare them in the Variable tags database or b) put your cicode in a library and call your function in the report. Note that you can still pass arguments to a function called in a report.

If you choose the second option and write your cicode in a library, then you can still use the Print() and PrintLn() functions in your cicode as they are still essentially being called from within a report. To generate a new line in your RTF format report you will need to call Print("\par "). Currently "\page" is not supported by Microsoft so it is not possible to do a form feed in an RTF format report.