>Benn:
>
>I am a rookie. How do I use the .ini file?
>
>
>>>When custom colors are created, VFP will not save the definitions between sessions. Is it possible to save these custom colors? How?
>>>
>>>Rob
>>
>>You can save the color settings in a table or in a .ini file each time you change the settings and then use the information next time you start the application.
This is the way I do it.
*-- DECLARE DLL statements for reading / writing to a .INI file
DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr ;
String cSection, String cKey, String cDefault, String @cBuffer, ;
Integer nBufferSize, String cINIFile
DECLARE INTEGER WritePrivateProfileString IN Win32API AS WritePrivStr ;
String cSection, String cKey, String cValue, String cINIFile
*-- Read data from .INI file. This is places in your startup program
IF GetPrivStr("Colorsettings", "Car not busy", "", @lcBuffer, LEN(lcBuffer), "My_IniFile.ini") > 0
nCarNotBusy = VAL(lcBuffer)
ELSE
nCarNotBusy = RGB(255,128,128) && DEFAULT IS NO SETTINGS FOUND
ENDIF
*-- Write data to .INI file. This is placed where you change your color settings
WritePrivStr("Colorsetings", "Car not busy", LTRIM(STR(nCarNotBusy)), "My_IniFile.ini")
Benn Kjaer
MS Certified Professional - Visual Foxpro
"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"