INI.Create

Top  Previous  Next

 

Syntax

function Ini.Create(): pointer

 

Description

Creates a new in memory INI-file, that can be used to read and write values. Use INI.SaveToFile to flush the contents to a file. You can destroy the object using INI.Free.

 

Returns a INI file object.

 

See also

INI.Open
INI.SaveToFile
INI.Free

 

Example

execute udsblock(filepath varchar(500))

returns(valueout varchar(2000), valueoutint integer, valueoutdouble double precision)

as

begin

  /* create in memory INI */

  myini = INI.Create();

  

  /* set the filename and save it empty */

  INI.SaveToFile(myini, filepath || 'new_ini_file.ini');

 

  INI.WriteString(myini, 'section1', 'value1', '1');

  INI.WriteString(myini, 'section1', 'value2', '2');

  INI.WriteString(myini, 'section2', 'value1', '1');

  INI.WriteString(myini, 'section2', 'value2', '2');

 

  /* update the file on disk */

  INI.UpdateFile(myini);

  INI.Free(myini);

    

  /* re-open the file */

  myini = INI.Open(filepath || 'new_ini_file.ini');        

  

  /* return entire contents */

  valueout = INI.GetStrings(myini);

 

  INI.Free(myini);

end