Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class calling a report - passing variables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00104020
Message ID:
00104024
Views:
24
>I'm trying to pass variables from one of my classes to a report. Do I need to make the variable public to pass it to the report? Will the variables be automatically released when the object is destroyed? In my current program, I've got a form (actually, it's a class/object based on a form). I also have another class I call from this form that does all of the work for the report. So in my print button on the form I do something like:
>
>lnReportType = THISFORM.Combo.Value
>lcLocation = THISFORM.Combo2.Value
>THISFORM.ReportObj.Print(lnReportType,lcLocation)
>
>In the ReportObj, Print Method I generate the cursor then run the report. I need to pass the lcLocation variable to the report so I can display this in the title(and, I guess pass the cursor). Help and suggestions appreciated. Now I understand why everyone wishes the reports were OO.

Public variables are visible for all applications and it's your responsibility to RELEASE them if necessary. OO-way is to replace public variables by properties of some object, i.e. you can always define custom class and instanciate object with necessary custom properties.
BTW, i guess, we discussed this already.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform