跳到主要内容

GetLength

如果 CDocBuilderValue 对象是数组/类型化数组,则返回长度。否则返回 0。

请注意,对于 .docbuilder 文件,不使用 CDocBuilderValue.GetLength 方法。

语法

def GetLength(self) -> int

参数

名称类型描述
resultlong*返回的对象长度。

示例

builder = docbuilder.CDocBuilder()
context = builder.GetContext()
globalObj = context.GetGlobal()
api = globalObj["Api"]
document = api.Call("GetDocument")
charts = document.Call("GetAllCharts")
length = charts.GetLength()