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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where should this code go?

Status
Not open for further replies.

jjschwartz

Technical User
Feb 3, 2004
23
US
The first thing my application needs to do is open a text file and read its contents into a string array that, I believe, will need to be a global variable. Then my main form takes over and does all the interfacing and work.

Where in the project should this initial reading of the file go? It seems like right after application.initialize in the project file would be appropriate but all the texts say not to modify this file and to leave it to Delphi if you're not an expert. I suppose it could be some initial code for my main form but then I have to suppress the showing of the form until after the file is read and I have to figure out how to make the array visible to all my other forms. Any advice?

TIA,
Jeff Schwartz
 
I'd create a separate unit(object) which handles the file stuff and call this from your main form for the initial read. This unit can be included in the 'uses' of the other forms for visibility and accessed when you need to.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top