Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DO FORM......NAME...LINKED
Message
 
 
To
28/05/1998 14:24:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00102548
Message ID:
00102893
Views:
35
Trisha,

Just release loCompany in the code after you are all done with it. That'll cause the form object to destruct and then the memvar will disappear. Although "technically" since you are making it PUBLIC you should name it goCompany. Or you have code that launches this whole thing right so you can work it like this to avoid a public memvar:

function DoingTheReport
private loCompany
report form MyReport
* your form runs because the report fires it off
return

Private scope memvars can be seen by any method or function called from the function that declares it. It'll automatically be released when the return executes.

I think what Ed was pointing out is that most people use a form as the outer level control, get the report criteria values the user wants and then in the click of a "Do Report" button:

public gHeader
gHeader = thisform.txtHeader.Value
report form MyReport

Ed also was advocating using custom properties of an external goApp object to hold these values instead of creating individual public memvars. Personally I just use public memvars for this because my framework only allows one report to be executing at a time.

>Changing loCompany from LOCAL to PUBLIC fixed my problem. cReportHeader now appears in my report.
>
>I do have one other issue. How do I close my hidden modal form?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform