GetPropertyName method (WinStudio scripts)

Applies To

IWSIDOCollection interface

Definition

Returns the name of a property, as specified by an integer, in a collection.

Syntax

object.GetPropertyName( long )

  Part   Description
object Required. The name of a valid IDO collection object.
long Required. A long integer corresponding to a property name. The first property name is associated with 0.

Remarks

The return value is a string containing the name of a property.

The names of the following properties can be retrieved by means of the GetPropertyName method:

  • 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

The GetNumProperties method returns the total number of properties in a collection. You can use the number to loop through property names. The association between a property name and an integer is set by the IDO.

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
Related topics