Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global properties or varables
Message
De
05/09/2005 23:03:55
 
 
À
05/09/2005 20:02:52
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01046793
Message ID:
01046884
Vues:
15
Cetin,Bonnie and Perry:

Thank you very much and excuse me as Perry said i didn't understand what a static value is, following your advices i could solve my problem. Coming from Fox i wanted to do things in "Fox" way .

Thank's again for your help.





>Juan,
>
>From your reply it is evident that you don't understand what a static value is.
>
>Static variables are tied to the class, not an object. They are not garbage collected until the app is unloaded. As Bonnie has said, they are tied to the class, not an object. And they are available as soon as the class is loaded. You can change their values at anytime, and see the new value when you reference the variable.
>
>For example, you can declare a static int inside a class. And use that as a counter, so everytime you instantiate an object from that class, you can increment your static, and you will always have a running total of how many times that class has been instantiated.
>
>You would have to create a class to run Main, if it wasn't declared static.
>
>>Bonnie: I know what you mean i create a public propertie in the midform and i set a value, but I can´t see that properties in the child forms where should i declare the propertie to be accessible for all forms, it is not a static value it is fixed by users and may be changed.
>>
>>Thank's
>>
>>>Juan,
>>>
>>>>is about an ini or configuration file which i use for set connection strings, i would like to use the custom object to retrieve and store info without using a file <
>>>
>>>You might have missed what Cetin was referring to in the link to the thread he posted. He specifically talks about using static constants (although, in your case, you'd need to use static properties, complete with get and set methods). Read this again ... Message #1040896
>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>
>>>>Cetin:
>>>> That's the way i use in fox , i store the custom object to a public variable or hang it on the _screen and i can read it from anywhere in my app, but i can't find the way in .net, the thread you pointed is about an ini or configuration file which i use for set connection strings, i would like to use the custom object to retrieve and store info without using a file for example i use a form to select a customer and i want to store his id in an object and then be accessed from any form in my application, as you said in fox i can keep that custom object as public variable or add it as an object to the _screen but i can not find the way in .net.
>>>>
>>>>i hope you ´ve understood me and tahnk you in advance for your help.
>>>>
>>>>
>>>>>>In Vfox i use _screen to hang properties or objects that can be accessed by forms , i m trying to do the same in .Net using a mdiform in which i create some public properties but i can't find the way for those propeties in MdiForm may be accessed by child forms.
>>>>>
>>>>>Juan,
>>>>>In VFP too normal way is to use a custom object (oMyApp) to store such info. You can do the similar in .Net. Check Thread #1040828 (it's C# but gives the idea).
>>>>>Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform