Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic application

Status
Not open for further replies.

ridzz

Programmer
Sep 30, 2001
23
0
0
MY
Hello,

I'm stuck. I want to make my application more dynamic. So, i want to create my global variables in a text file outside the application. This in theory will enable my application to function just by changing the text file. I don't want any hardcode (as far as i can) in my application. Is this possible?

Hope u guys can help me.
RIDZ
 
When you say create global variables in a text file what exactly do you mean? If you want to add more variables after compile time then no you can't do this, If you want to do what I think you mean and store values in a text file to be read in to the program, then yes you can do that. There are several ways to do it.

1) write your own routine to open and read the values when the program starts, then assign them to your global variables.
2) Use an ini file and read it and assign to your global variables.
3) use the registry to hold values (this would be my prefered method)

for all of these there are probably good explanations in other threads on here, just do a search. if not post back and I'll put something up here.

Matt
 
Ok thanx.. That's just what i've been looking for.
 
To anyone interested.. You can get the information needed in these FAQs..

faq222-39 How To Read/Write to Ini files using ...PrivateProfile... API commands

faq222-1198 How do I use INI files

faq222-92 Reading and Writing Registry Values


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top