Previous - iniWrite Section Home - Registry and INI Next - iniList


iniDelete ( )

Deletes a section or key from an existing INI file

Usage:

iniDelete (object me, string section, string key, string filePath)

Parameters:

section (string) - The section name in an INI file excluding the [ ] signs

key (string) - The key name in a INI file without the trailing = sign. To delete an entire section, leave parameter EMPTY

filePath (string) - The path to an existing INI file

Returns:

(integer) - The success code

Example 1:

-- removes the DisplayFullLingoErrorText key from Director ini file
xtRose = xtra("Rosetta").new( )

-- get the moviename without file extension
strMovieName = the movieName
nLen = strMovieName.length
delete strMovieName.char[(nLen-2)..nLen]

xtRose.iniDelete( "Lingo", "DisplayFullLingoErrorText", the moviepath&strMovieName&"ini" )

Example 2:

-- deletes the entire [Settings] section from the projector's ini file
xtRose = xtra("Rosetta").new( )

-- get the moviename without file extension
strMovieName = the movieName
nLen = strMovieName.length
delete strMovieName.char[(nLen-2)..nLen]

xtRose.iniDelete( "Lingo", EMPTY, the moviepath&strMovieName&"ini" )

Notes:


Previous - iniWrite Section Home - Registry and INI Next - iniList