Iteration

www.altova.com Imprimir este apartado Página anterior Subir un nivel Página siguiente

Inicio >  Referencia del programador > Application API > Overview > Programming Languages > JScript >

Iteration

The JScript listing below shows how to iterate through the open documents. It is assumed that you have already started the application and opened some documents as shown in the previous sections.

 

// go through all open documents using a JScript Enumerator
for (var iterDocs = new Enumerator(objStyleVision.Documents); !iterDocs.atEnd(); iterDocs.moveNext())
{
  objName = iterDocs.item().Name;
  WScript.Echo("Document name: " + objName);
}
 
// go through all open documents using index-based access to the document collection
for (i = objStyleVision.Documents.Count; i > 0; i--)
  objStyleVision.Documents.Item(i).Close();

 

The JScript code listed above is available in the sample file DocumentAccess.js (see Example Files).


© 2019 Altova GmbH