Count

설명

콜렉션에 있는 항목 수를 리턴합니다. 이 특성은 읽기 전용입니다.

구문

VBScript

collection.Count 

Perl

$collection->Count(); 
ID
설명
collection
레코드의 한 필드에 있는 첨부 세트를 나타내는 Attachments 콜렉션 오브젝트.
Return value
콜렉션 오브젝트 내의 항목 수를 표시하는 Long을 리턴합니다. 콜렉션에 항목이 포함되어 있지 않은 경우 이 메소드는 0을 리턴합니다.

예제

VBScript

' This example assumes there is at least 1 attachment field 
' associated with the record.
set currentSession = GetSession  set attachFields = AttachmentFields 
set attachField1 = attachFields.Item(0) 
set theAttachments = attachField1.Attachments 
numAttachments = theAttachments.Count
For x = 0 to numAttachments - 1
     set attachment = theAttachments.Item(x)
     ' Do something with the attachments
Next

Perl

#Get a list of attachments
$attachfields = $entity->GetAttachmentFields();

# Get the first attachments field
$attachfield1 = $attachfields->Item(0)

# Get the collection of attachments from the attachments field
$attachments = $attachfield1->GetAttachments();
#Get the number of attachments
numAttachments = $attachments->Count(); 

피드백