6.3 Write method

Writes a buffer and Entry in a file.

6.3.1 Syntax

object.Write( 
   FileName As String, 
   Section As String, 
   Entry As String, 
   Buffer As String)

6.3.2 Parameters

FileName

The name of the file to write to.

Section

The section in the file to write to.

Entry

The entry that corresponds to the String.

Buffer

The String to be written.

6.3.3 Return Values

Boolean. Returns TRUE if the values are successfully written to the file. Else returns FALSE.

6.3.4 Example

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

6.3.5 See Also