我们在使用PB的INI函数读写INI文件时,有时也可能需要动态地删除某个节或者某个项,此函数即完成此功能。此函数是从PFC里分离出来的,希望对大家有用。
$PBExportHeader$pfc_delprofilestring.srf
$PBExportComments$Delete SECTION or KEY in INI file
global type pfc_delprofilestring from function_object
end type
forward prototypes
global function integer pfc_delprofilestring (string as_file, string as_section, string as_key)
end prototypes
global function integer pfc_delprofilestring (string as_file, string as_section, string as_key);// Function: of_Delete
// Arguments:
// as_file The .ini file.
// as_section The section name that the entry to be deleted is in.
// as_key The key name of the entry that should be deleted from
// the specified section.
// (此参数为空值时删除整个节).
// Returns: Integer
// 1 success
// 0 section does not exist, or key name does not exist
// within specified section.
// -1 fil