Valid on UNIX and Windows
The WriteIniSection function creates or overwrites an entire section in a specific initialization (.ini) file. If the .ini file does not exist, this function creates it.
This initialization file (.ini) function has the format:
WriteIniSection(section as String, value as String, filename as String) as Boolean
Identifies the name of the section to be written. If the section does not exist, this function creates it.
Identifies the entries to be written. The entries in value must have the following format:
Entry_1 = Value_1 <LF>
Entry_n = Value_n <LF>
Specifies the name of the initialization file.
On successful completion, the function returns TRUE; otherwise, it returns FALSE.
Example: WriteIniSection function
Dim entries as String
Dim LF as String
LF = chr(10)
entries = "Entry_1 = Value_1" + LF + "Entry_n = Value_n"
Rem this example writes to c:\temp\test.ini the section LIST
Dim attrList as String
lf = chr(10)
attrList = "Entry_1=Value_1"+lf+"Entry_2=Value_2"
If Not(WriteIniSection("LIST", attrList, "c:\temp\test.ini")) Then
MessageBox("Can not create LIST section", "DMS", MB_OK + MB_ICONEXCLAMATION)
SetStatus(1)
Exit
End If
|
Copyright © 2013 CA.
All rights reserved.
|
|