Documents Property


Description

Provides access to all projects within an instance of BrainVoyager.

Syntax

objDocumentCollection objBrainVoyager.Documents()

Remarks

This method retrieves a collection of all documents available in the accessed BrainVoyager instance. You can loop through the set of objects by using the "For each" control structure or access documents via the item command. There are some differences between the scripting languages about how collections are accessed (see script language documentation).

Example

' VBScript - full code in file "CycleThroughDocuments.vbs"
Set
docs = BrainVoyager.Documents
MsgBox
"Press OK to iterate through all " & docs.Count & " documents"
For
Each doc In docs
 
MsgBox "doc.PathName=" & doc.PathName
Next

// JScript - full code in file "CycleThroughDocuments.js"
count = BrainVoyager.
Documents.Count
d
ocs = new Enumerator(BrainVoyager.Documents);
message = "Press OK to iterate through all " + count + " documents";

WshShell.
Popup(message, 2, "BrainVoyager Script");
for
( ; !docs.atEnd(); docs.moveNext())
{

  doc = docs.
item();
  WshShell.
Popup("doc.PathName = " + doc.PathName + " ", 2, "BrainVoyager Script");
}

 

# PerlScript - full code in file "CycleThroughDocuments.pl"
$docs = $BrainVoyager->
Documents();
$message = "Press OK to iterate through all " . $docs->
Count() . " documents";
$WshShell->
Popup($message, 2, "BrainVoyager Script");
foreach
my $doc (in $docs)
{

  $WshShell->
Popup($doc->PathName(), 2, "BrainVoyager Script");
}