DataObject.GetAttachedInt

Prototypes

int GetAttachedInt( String sName, int nDefaultValue )

Return Value

The return value is the attached integer value. If there is no attachment with the specified name, the return value is nDefaultValue.

Parameters

String sName
The name of the attachment.

int nDefaultValue
The value to return if there is no attachment with the specified name.

Remarks

This method returns the attachment with the specified name. The attachment must have been added using the method AddAttachedInt.

The DataObject class enables you to add attachments to a DataObject. This enables you to associate additional information about the data in a DataObject with the DataObject itself. The DataObject does not use your attachments. Note that attachments exist only in memory. They are not stored when you store the DataObject.

Example
declare DataObject dobj = DataObject.Create( "Example" );
x = rannor( 1:100 );
dobj.AddVar( "X", x );

count = ncol( loc( x > 0 ) );
dobj.AddAttachedInt( "Count X > 0", count );

n = dobj.GetAttachedInt( "Count X > 0", -1 );
print n;
See Also

DataObject.AddAttachedInt