Iterations

www.altova.com Imprimer cette rubrique Page précédente Un niveau supérieur Page suivante

Accueil >  Programmers' Reference > Application API > Overview > Programming Languages > Java >

Iterations

The listing below shows how to iterate through open documents.

 

 

01 // Iterate through all open documents and set the View mode to 'Text'.

02 for (Document doc:authenticDesktop.getDocuments())

03   if ( doc.getCurrentViewMode() != SPYViewModes.spyViewText)

04           doc.switchViewMode(SPYViewModes.spyViewText);

05

06 // An alternative iteration mode is index-based. COM indices are typically zero-based.

07 Documents documents = authenticDesktop.getDocuments();

08 for (int i = 1; i <= documents.getCount(); i++)

09   {

10     Document doc = documents.getItem(i);

11     ...  

12   }

 


© 2019 Altova GmbH