To create a file you can always do

Open (1,"my_ini_file.ini",5)
Close (1)

As for writing the line you would use WriteProfileString()

 Quote:

WRITEPROFILESTRING
Action


Copies a string to an initialization file.



Syntax


WRITEPROFILESTRING ("file name", "section", "key", "string")



Parameters


File name

String identifying the initialization file. If this parameter does not include a full path, Windows searches for the file in the Windows directory.

Section

String containing the name of the section of the initialization file where string is copied. If the section does not exist, it is created. The section name is not case-sensitive, and can contain any combination of uppercase and lowercase letters.

Key

String containing the name of the key to associate with string. If the key does not exist in the specified section, it is created. If this parameter is empty, the entire section, including all entries within the section, is deleted.

String

String to write to the file. If this parameter is empty, the key identified by key is deleted.



Note


On Windows 9x, use of the tab character (\t) is not supported as part of this parameter.



Remarks


This function is provided for compatibility with 16-bit Windows-based applications. Win32-based applications store initialization information in the registry.

Returns




0
Profile string written

Error code
Function failed

_________________________
Today is the tomorrow you worried about yesterday.