_NewEnum

www.altova.com このトピックを印刷 前のページ 1つ上のレベル 次のページ

ホーム >  The MapForce API > Object Reference > Project >

_NewEnum

Property: _NewEnum () as IUnknown (read-only)

 

Description

This property supports language-specific standard enumeration.

 

Errors


1500

The object is no longer valid.

 

Examples

 

// ------------------------------------------------------------

// JScript sample - enumeration of a project's project items.

function AllChildrenOfProjectRoot()

{

   objProject = objMapForce.ActiveProject;

  if ( objProject != null )

   {

      for ( objProjectIter = new Enumerator(objProject); ! objProjectIter.atEnd(); objProjectIter.moveNext() )

       {

           objProjectItem = objProjectIter.item();

 

          // do something with project item here

       }

   }

}

 

// ------------------------------------------------------------

// JScript sample - iterate all project items, depth first.

function IterateProjectItemsRec(objProjectItemIter)

{

  while ( ! objProjectItemIter.atEnd() )

   {

       objProjectItem = objProjectItemIter.item();

      // do something with project item here

 

       IterateProjectItemsRec( new Enumerator(objProjectItem) );

 

       objProjectItemIter.moveNext();

   }

}

function IterateAllProjectItems()

{

   objProject = objMapForce.ActiveProject;

  if ( objProject != null )

   {

       IterateProjectItemsRec( new Enumerator(objProject) );

   }

}

 


(C) 2019 Altova GmbH