Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Error when accessing Global variables in Functions (6.03)

edited January 2003 in RAP
I declared the variable dow : string in Global-Declarations.
In Global - OnCreate, I set this variable, and do a showmessage just to
check. Works fine.
Declared a function in Global - Programs. This compiles fine, using the dow
variable.

DetailBeforePrint calls the function that tries to access dow.
When I put (in the subfunction):
showmessage('Point 1');
showmessage(dow);
showmessage('Point 2');

It shows "Point 1", but fails when trying to show the contents of dow with
"Cannot genearate report.
Could not run program: DetailBeforePrint".

ReportBuilder Enterprise v6.03 and Delphi 5.0
(We are planning to upgrade to RB7, but haven't got that far. We also need
to consider the customers, that have big problems re-scripting and replacing
the executables every week).

Best Regards,
Paul Wiik, Lynx Technologies

Comments

  • edited January 2003
    Just discovered that if I "touch" the global variables at the end it works.
    More precisely:
    After a modification to a Global -Programs - procedure/function, I must go
    to Global - declaration and modify the text (to force the variables to be
    recompiled or something). Then it works.

    Paul Wiik

  • edited January 2003
    What if you right mouse click and choose "Compile" for the program? Does
    that help? I would suggest installing RB 7 on a test machine to see if the
    problem goes away. We have made modifications to RAP to enhance it and some
    bug fixes since RB 6.03 was released.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited January 2003
    Jim,

    Thanks for the answer. I believe I tried that, but it didn't work, so I
    added a space, and hit delete to move it, and it worked, but when I now
    tried to confirm this, it works all the time! The error is gone.
    I completed the report by doing this trick (going into the global variables,
    or onBeforePrint as I also discovered made the effect). Now that it's
    finalized it works (I only managed to make it fail once after reading your
    post).

    The only thing I can think of that has changed in the functions/procedures
    is that I re-activated some code that was commented out previously.
    Ok, hopefully we will have 7.0 installed soon, and it will not be a problem
    anymore.

    Best Regards,
    Paul

This discussion has been closed.