文档中心
v3.4

SequoiaDB 简介

安装部署

数据库实例

分布式引擎

SAC 管控中心

参考手册

常见问题及解答(FAQ)

版本信息

setComment()

名称

setComment - 设置指定 item 的注释

语法

IniFile.setComment( <section>, <key>, <comment>, [pos] )

IniFile.setComment( <key>, <comment>, [pos] )

类别

IniFile

描述

设置指定 item 的注释。

参数

参数名 参数类型 默认值 描述 是否必填
section string --- 段名
key string --- 键名
comment string --- 设置的注释
pos boolean true true: 前置注释; false: 后置注释

返回值

执行成功,无返回值.

执行失败,抛异常。

错误

如果出错则抛异常,并输出错误信息,可以通过getLastErrMsg()获取错误信息或通过getLastError()获取错误码。关于错误处理可以参考常见错误处理指南

常见错误可参考错误码

版本

v3.2 及以上版本

示例

  • 打开一个 INI 文件。

    > var ini = new IniFile( "/opt/sequoiadb/file.ini", SDB_INIFILE_FLAGS_DEFAULT )
  • 设置指定 item 的注释。

    > ini.setComment( "info", "name", "what's your name" )
回到顶部