Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global variables with Reports for testing - how
Message
 
To
31/08/1999 00:09:54
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00259501
Message ID:
00259687
Views:
15
>Steve
>
>I ended up creating the PUBLIC variables in INIT of the form that acts as my report menu... this is where the reports are actually called from. That seems to work and I just have to watch the TESTING stages for the 2nd form that controls the info collection for the report.
>
>Basically the "BUTTON" with the report name does something like this via the CLICK....
>
>LOCAL pRun
>DO FORM timepro\repinfo WITH "Client Master","F" TO pRun
>if pRun=1
> REPORT FORM timepro\clientmaster PREVIEW FOR firmid=gFirmid
>endif
>
>NOTE: gFirmId is one of my public variables.
>
>I did try switching that PUBLIC to PRIVATE I received an error in the info form saying the variable was not declared. Based on what you said, shouldn't it have been?
>
>
>
>
Peter,
If the variables you switched to PRIVATE are declared in the Init for the form, they will not exist in the Click event. Once the Init has finished, those variables will be out of scope and destroyed. If the variables are declared PRIVATE in your Click event, they will be visible to the report. If I need a variable to be visible to all methods in a form, I make it a property. If I need to pass it to a report, I use a PRIVATE variable in the method that invokes the report to do it. Avoid using global variables if at all possible. They're convenient but you can pay for it with bugs that are extremely difficult to find.
Steve Ruhl
CitiMortgage, Inc.
steven.ruhl@citibank.com Office
Steve@steven-ruhl.com Home
Previous
Reply
Map
View

Click here to load this message in the networking platform