Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inconsistencies with running method from report
Message
De
03/01/2000 20:59:47
Chris Crachiolo
Blackmoor Associates Incorporated
New York City, New York, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Inconsistencies with running method from report
Divers
Thread ID:
00312074
Message ID:
00312074
Vues:
69
A form launches a report; the form has a method that is called by the report, i.e., a report variable is defined that's reset at the data grouping "RECNO()" and both the "value to store" and "initial value" contain "THISFORM.MyMethod()". The report variable itself is just a dummy, and the method returns an empty string. The actual work done by the method involves assigning values to PUBLIC variables (yeah, I know -- bad idea -- but they only exist during printing -- I'm making sure they're released -- and nothing else is going to happen while printing anyway). These public variables consist of one array and some other non-array variables.

If I print the report for a scope of one record, everything is fine. However, if the scope is more than one record, the public variables appearing (or influencing output on) the report for subsequent records contain the values for the PREVIOUS record (I've actually confirmed this only for some of the variables) -- EXCEPT for the public array, which is always correct.

It's obviously something happening during the report processing, since as a test I ran the method code from a SCAN loop instead of REPORT FORMing, and watched the variables during execution with the debugger -- the values were always fine, regardless of the record scope.

I can work around this by REPORTing only one record at a time (each record appears on a separate page anyway), but ....

Any ideas? Or is trying to do too much behind the scenes during REPORTing just a bad idea?
"Ignorance more frequently begets confidence than does knowledge."
-- Charles Darwin
"I am invincible! Invincible...OWWWWWWWW!"
-- Homer Simpson
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform