PB中对INI文件读写的补充函数:删除指定的节或者指定节中某个项

本文提供了一个PowerBuilder(PB)中用于删除INI文件指定节或项的函数,该函数从PFC库中独立出来,能够根据需要动态删除文件中的特定部分。函数接受文件名、节名和键名作为参数,成功删除后返回1,否则返回错误代码。
摘要由CSDN通过智能技术生成

我们在使用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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值