Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing values to a text file
Message
From
13/01/2005 11:31:27
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00976803
Message ID:
00976811
Views:
8
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform