GetNumProperties method (WinStudio scripts)

Applies To

IWSIDOCollection interface

Definition

Returns the number of properties in a specified collection. Read-only.

Syntax

object.GetNumProperties( )

  Part   Description
object Required. A reference to an IDO collection object.

Remarks

This method returns the total number of properties in a collection.

The return value is a long integer indicating the number of properties in a collection.

Note: You can use this number to loop through the properties in a collection. See the following "Example" section.

This method counts the following properties:

  • Properties bound to visible components on a form
  • Properties bound to hidden components
  • Key fields that are not bound to components but are needed by the IDO to execute a SELECT clause in a query
  • The NoteExistsFlag property and the _ItemId property, which are available in all collections

Example

Sub Main()
   Dim i As Integer
   Dim iNumEntries As Long
   Dim propertyMsg As String
   i = 0
   ThisForm.SetFocus("grid1")
   iNumEntries = ThisForm.CurrentIDOCollection.GetNumProperties()
   propertyMsg = ""
   Do While i < iNumEntries
       propertyMsg = propertyMsg & "   Property " & (i + 1) & ": " & _
          ThisForm.CurrentIDOCollection.GetPropertyName(i) & vbLf
       i = i + 1
   Loop
   Application.ShowMessage("Total number of properties in this collection: " _
      & iNumEntries & vbLf & vbLf & "Properties are: " & vbLf & propertyMsg)
End Sub