Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create customised configuration file?
Message
From
09/07/1999 15:05:37
 
 
To
29/06/1999 16:25:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00235476
Message ID:
00239596
Views:
22
Hi Mark,
I've had another look and put this code in my main.prg

***** OPEN MYCFG.TXT CONFIGURATION FILE *****
IF FILE('c:\WINDOWS\SYSTEM\mycfg.txt') THEN
handle=FOPEN("c:\WINDOWS\SYSTEM\mycfg.txt")
STORE FSEEK(handle,0,2) TO fEnd && Move pointer to EOF
FSEEK(handle,0) &&goto BOF
DO WHILE !FEOF(handle) &&do until endoffile
tmpline=FGETS(handle,fEnd) && Store contents
&tmpline
ENDDO
FCLOSE(handle) && Close the file
ELSE
&&raise exception dialog box
CLOSE ALL
CLEAR ALL
QUIT
ENDIF
RELEASE handle, fEnd, tmpline

The mycfg.txt is just a textfile containing a list of my public vars and their searchpath assignments eg.
daytapath='c:\app\dayta'
I basically read each line and use & symbol to declare and assign them.
Previous
Reply
Map
View

Click here to load this message in the networking platform