Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class calling a report - passing variables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00104020
Message ID:
00104161
Vues:
23
>>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.
>
> What I'm wondering, though, is can I pass a variable/object to the report w/o making it public? Since I already have an object that has all of the information available in it I'd like to use this as a reference in my report instead of creating a public variable, assigning the value from my object, then referencing that in my report. The reason I ask is that I've tried using my object properties from a report and it can't find the object.
>
>My form object creates an object from my "Generate Report" class. In this class (in my PRINT method) I then do a REPORT FORM report TO PRINTER NOCONSOLE. Then in my report I'm trying to reference my object properties (via oReport.Property). No go.

When you create any object you should link to some place you already know how to refer. For example, if you are in form, and createobject() then normal OO practice is to add form custom property MyForm.oNewObject and instanciate the object using:
Thisform.oNewObject=createobject(....)
Now, you have entry point to call everything from this object:
Myform.oNewobject.Property1
Myform.oNewobject.Method2
etc.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform