Neil
prog WRITEINI.PRG:
PARAMETERS cSection, cEntry, cValue, cINIFile
LOCAL nRetVal
DECLARE Integer WritePrivateProfileString IN WIN32API ;
STRING cSection, ;
STRING cEntry, ;
STRING cValue, ;
STRING cINIFile
nRetVal = WritePrivateProfileString(cSection, ;
cEntry, ;
cValue, ;
cINIFile)
RETURN nRetVal=1
Called as:
= WRITEINI( "PATHS", "UserName", "Neil", {path to USERNAME.INI or Char var})
HTH
Terry
>I have a form which is initialised when the user starts the program. This gives the users the ability to select their name from the list. What I want to do when they select and then click ok is to write the value (username) to a text file named username.ini.
>
>The contents of the username.ini is as follows:
>
>[PATHS]
>homedrive=
>datapath=
>username=
>
>When the user clicks ok I would like the username to be inserted in ini file next to username so it should look like this:
>
>[PATHS]
>homedrive=
>datapath=
>username=neil
>
>Is this possible?
>
>Many Thanks
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.