Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I read .ini file entries??
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00400961
Message ID:
00404014
Views:
60
I use the following code; Hope help you

DECLARE INTEGER GetPrivateProfileString ;
IN WIN32API ;
STRING cSection,;
STRING cEntry,;
STRING cDefault,;
STRING @cRetVal,;
INTEGER nSize,;
STRING cFileName

lcInivalue=Space(20)
pcFileName="C:\mydirectory\myconfig.ini"

*- PcFileName must have the full path where the ini file is located
lnResult=GetPrivateProfileString([DATA],"Path","*None*",;
@lcIniValue,LEN(lcIniValue),pcFileName)

******
* myconfig.ini
*[DATA]
*path=C:\dbfs\
*temp=C:\temp\
*[Others}
*

*- lcInivalue will return c:\dbfs\
Juan C.
"Anyone who has never made a mistake has never tried anything new." A.E
"The important thing is not to stop questioning. Curiosity has its own reason for existing." A.E
Previous
Reply
Map
View

Click here to load this message in the networking platform