473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Global properties

Art
Hi,

I could really use some suggestions. I've got a project that has a few
global variables -- such as default paths. I'd like to save and recall them.
It seemed to me that the best way is to serialize them to an XML file.

Normally, if I have a few global variables I put them in a module. I don't
know if I can serialize a module -- it seems fairly easy to serialize a class.

I assume everyone has to do something like this, and that there must be a
fairly standard way of handling these variables. Can anyone offer me any
suggestions?

Thanks very much

Art
Nov 21 '05 #1
2 1084
I don't believe you can serialize a module but you can create a serializable
class that has all your variables as properties then serialize it to a file
when you exit your application and deserialize it when your application
starts. You can the access the properties of the class.
--
Dennis in Houston
"Art" wrote:
Hi,

I could really use some suggestions. I've got a project that has a few
global variables -- such as default paths. I'd like to save and recall them.
It seemed to me that the best way is to serialize them to an XML file.

Normally, if I have a few global variables I put them in a module. I don't
know if I can serialize a module -- it seems fairly easy to serialize a class.

I assume everyone has to do something like this, and that there must be a
fairly standard way of handling these variables. Can anyone offer me any
suggestions?

Thanks very much

Art

Nov 21 '05 #2
Art,

The answer is simple. Try to avoid modules (you don't really need them,
although a shared class is almost the same)..

Cor
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Relaxin | last post by:
How can I have a variable that has been initialized and set to a value within one source file (*.cs), and have access to that same variable in other files of the same project? NOTE: That...
8
by: lawrence | last post by:
I'm learning Javascript. I downloaded a script for study. Please tell me how the variable "loop" can have scope in the first function when it is altered in the second function? It is not defined...
1
by: Robert North | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've just started programming JS, and one question keeps nagging me: I can insert a <script> element anywhere in HTML, and when it's executed...
2
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document...
25
by: Sahil Malik [MVP] | last post by:
So here's a rather simple question. Say in an ASP.NET application, I wish to share common constants as static variables in global.asax (I know there's web.config bla bla .. but lets just say I...
7
by: JerryW | last post by:
I just reinstalled .NET 2003 (after repeated attempts to get ASP.NET Web Applications to work). I first did a complete uninstall of .NET 2003, .NET Framework 1.1, and IIS. I also completely deleted...
15
by: randyr | last post by:
I am developing an asp.net app based on a previous asp application. in the asp applications global.asa file I had several <object id="id" runat="server" scope="scope" class="comclass"> tags for...
3
by: Nathan | last post by:
Somebody help please, I am desperate for help as I've battled this problem for 3 days now! :( I have an application (NT Service) that uses 2 threads... one worker-thread (i.e. always running)...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
15
by: Bob | last post by:
Is there anyway to access the global object from inside a function other than doing a "var _global = this;" before declaring the function? Thanks
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.