Main Content

hasNext

Class: systemcomposer.rptgen.finder.ComponentFinder
Namespace: systemcomposer.rptgen.finder

Determine if component search result queue is nonempty

Since R2022b

Syntax

nonempty = hasNext(finder)

Description

nonempty = hasNext(finder) determines whether the Component search result queue is nonempty.

Input Arguments

expand all

Component finder, specified as a systemcomposer.rptgen.finder.ComponentFinder object.

Output Arguments

expand all

Whether queue is nonempty, returned as 1 (true) or 0 (false).

Data Types: logical

Examples

expand all

Use the ComponentFinder and ComponentResult classes to generate a report.

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

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

componentFinder = ComponentFinder("mTestModel");
componentFinder.Query = AnyComponent;
  
chapter = Chapter("Components in mTestModel");
  
while hasNext(componentFinder)
    componentResult = next(componentFinder);
    sect = Section(componentResult.Name);
    add(sect,componentResult);
    add(chapter,sect);
end

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

Version History

Introduced in R2022b