Writes a buffer and Entry in a file.
object.Write(
FileName As String,
Section As String,
Entry As String,
Buffer As String)
The name of the file to write to.
The section in the file to write to.
The entry that corresponds to the String.
The String to be written.
Boolean. Returns TRUE if the values are successfully written to the file. Else returns FALSE.
This example writes the buffer VALUE1 and entry KEY1, as well as the buffer VALUE2 and entry KEY2, to the file Sys:delme.ini under the section APP.Then, it searches and returns the values corresponding to the entries KEY1, DEFAULT1, TEST-DEFAULT1 and TEST-DEFAULT2 from the file APP.
Sub Main
Set Prof=CreateObject("UCX:Profile")
’Writes the buffer VALUE1 and the entry KEY1 in the section
’APP in the file SYS:delme.ini
Prof.Write("Sys:delme.ini", "APP", "KEY1", "VALUE1")
Prof.Write("Sys:delme.ini", "APP", "KEY2", "VALUE2") ’Searches for the entry KEY1 in section APP in the file ’Sys:delme.ini and prints the buffer value P int(Prof.Read("Sys:delme.ini", "APP", "KEY1", "DEFAULT1")) Print(Prof.Read("Sys:delme.ini", "APP", "KEY3", "TEST-DEFAULT1"))
Print(Prof.Read("Sys:delme.ini", "APP", "KEY2", "TEST-DEFAULT2"))
End Sub