CheckIntegrity method

The CheckIntegrity method determines whether a batch conforms to the document integrity rules that are specified in the Setup DCO file.

This method is typically used after the CreateDocuments method.

Syntax

VBScript
oDCO CheckIntegrity (pLastChecked as Object ) as Long.
C#
int CheckIntegrity(out object pLastChecked)

Arguments

pLastChecked
Variable to contain the last object that is checked in case of an error.

Returns

One of the following values:
0
Passed
1
Has more child objects than allowed by the max attribute.
2
Has fewer child objects than required by the min attribute.
3
Invalid member. A child object is not of a type that is supported by the parent.
4
A child object is in the wrong position relative to other child objects as specified by the pos attribute.

Applies to

All object types except character objects. When applied to a batch or document, the method checks to the page level but not lower to a field or character object. When applied to a page, the method checks fields on that page.

VBScript example

This example creates documents in a batch and applies integrity rules. If an error is encountered, the code opens a message box that displays the type of error (1-4). The message box also displays the object and the ID that are the source of the error.
Dim DocInt
Dim LastChecked
Call oDCO.CreateDocuments
DocInt = oDCO.CheckIntegrity(LastChecked)
If DocInt > 0 Then
msgbox "Document Integrity problem = " & DocInt
msgbox "Detected at " & LastChecked.ObjectType & " type object ID " & LastChecked.ID
End If

C# example

This example populates the runtime and setup DCO objects, and checks the integrity of the runtime batch.
m_oDCO.Read("C:\\Datacap\\APT\\batches\\20100096.001\\Verify.xml");
m_oDCO.ReadSetup("C:\\Datacap\\APT\\dco_APT\\APT.XML");
Object pLastChecked = null;
int nRetVal = m_oDCO.CheckIntegrity(out pLastChecked);