主要内容

本页采用了机器翻译。点击此处可查看英文原文。

hasNext

类: systemcomposer.rptgen.finder.AllocationListFinder
命名空间: systemcomposer.rptgen.finder

确定分配列表搜索结果队列是否非空

自 R2022b 起

语法

nonempty = hasNext(finder)

说明

nonempty = hasNext(finder) 决定 AllocationList 搜索结果队列是否为空。

输入参数

全部展开

分配列表查找器,指定为 systemcomposer.rptgen.finder.AllocationListFinder 对象。

输出参量

全部展开

队列是否为非空,以 1 (true) 或 0 (false) 返回。

数据类型: logical

示例

全部展开

使用 AllocationListFinderAllocationListResult 类生成报告。

import mlreportgen.report.*
import slreportgen.report.*
import systemcomposer.rptgen.finder.*

rpt = slreportgen.report.Report(output="AllocationListFinderReport",...
CompileModelBeforeReporting=false);
add(rpt,TitlePage("Title","Allocations"));
add(rpt,TableOfContents);

allocationListFinder = AllocationListFinder("AllocationSet.mldatx");
allocationListFinder.ComponentName = "mTestModel/Component1";
chapter = Chapter("Title","Allocations");
while hasNext(allocationListFinder)
    allocations = next(allocationListFinder);
    sect = Section("Title",allocationListFinder.ComponentName);
    add(sect,allocations);
    add(chapter,sect);
end

add(rpt,chapter);
close(rpt);
rptview(rpt);

版本历史记录

在 R2022b 中推出