Examples: Fields property (NotesForm - LotusScript)

This script displays the names of all the fields on a form.

Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
formNameIn = Lcase(Inputbox("Name of form?"))
Forall form In db.Forms
  If Lcase(form.Name) = formNameIn Then
    If Isempty(form.Fields) Then
      Messagebox form.Name & " has no fields"
    Else
      fieldCount = 0
      msgString = ""
      Forall field In form.Fields
        fieldCount = fieldCount + 1
        msgString = msgString & Chr(10) & _
        "     " & field
      End Forall
      Messagebox form.Name & " has " & _
      fieldCount & _
      " field(s):" & Chr(10) & msgString
    End If
    Exit Sub
  End If
End Forall
Messagebox "The form """ & formNameIn & """ does not exist"