コレクション内で現在の文書または指定された文書の、直前の文書を取得します。
パラメータ | 説明 |
---|---|
doc | コレクション内の任意の文書。NULL にすることはできません。 |
戻り値 | 説明 |
---|---|
NotesDocument | パラメータを指定しない場合、現在の文書の直前の文書を返します。パラメータを指定した場合は、指定された文書の直前の文書を返します。直前の文書がない場合は NULL を返します。 |
ループ内で文書を取得すると、動的メモリをすぐに使い尽くしてしまいます。 メモリ問題を避けるには、var tmpdoc = getPrevDocument(); doc.recycle(); doc = tmpdoc のようなシーケンスを使用して、反復ごとに NotesDocument オブジェクトをリサイクルします。
var dc:NotesDocumentCollection = database.getAllDocuments();
var doc:NotesDocument = dc.getLastDocument();
while (doc != null) {
requestScope.status += "¥n" + doc.getItemValueString("subject");
var tmpdoc:NotesDocument = dc.getPrevDocument();
doc.recycle();
doc = tmpdoc;
}
var dc:NotesDocumentCollection = database.getAllDocuments();
if (dc.getCount() > 1) {
var doc:NotesDocument = dc.getPrevDocument(dc.getLastDocument());
requestScope.status = doc.getItemValueString("subject");
doc.recycle();
}
LotusScript® NotesDocumentCollection クラスの GetPrevDocument メソッド
Java™ DocumentCollection クラスの getPrevDocument メソッド