• setSectionComment()
    • 语法
    • 类别
    • 描述
    • 参数
    • 返回值
    • 错误
    • 示例

    setSectionComment()

    语法

    IniFile.setSectionComment( <section> <comment> )

    类别

    IniFile

    描述

    设置指定 section 的注释。

    参数

    参数名参数类型默认值描述是否必填
    sectionstring—-段名
    commentstring—-添加的注释

    返回值

    执行成功,无返回值.

    执行失败,抛异常。

    错误

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

    常见错误可参考错误码。

    示例

    • 打开一个 INI 文件。
    1. > var ini = new IniFile( "/opt/sequoiadb/file.ini", SDB_INIFILE_FLAGS_DEFAULT )
    • 设置指定 section 的注释。
    1. > ini.setSectionComment( "info", "personal information" )