例: Readers property

  1. 次の例は読者名を定義したフィールドに名前を追加します。
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim form As NotesForm
    Dim newReaders(0 To 63) As String
    Dim reader As String
    Set db = session.CurrentDatabase
    Set form = db.GetForm(Inputbox("Name of form?"))
    If Isempty(form.Readers) Then
      n = 0
    Else
      For j = 0 To Ubound(form.Readers)
        newReaders(j) = form.Readers(j)
        Messagebox "Current reader: " & newReaders(j)
      Next
      n = Ubound(form.Readers) + 1
    End If
    reader = Inputbox("Name of reader?")
    Do While reader <> ""
      newReaders(n) = reader
      reader = Inputbox("Name of reader?")
      n = n + 1
    Loop
    form.Readers = newReaders
  2. 次の例は、読者名を定義したフィールドの内容を置き換えます。
    REM Replaces $READERS in total with what the _
    REM user specifies here
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim form As NotesForm
    Dim newReaders(0 To 63) As String
    Dim reader As String
    Dim emptyReaders As Variant
    Set db = session.CurrentDatabase
    Set form = db.GetForm(Inputbox("Name of form?"))
    n = 0
    reader = Inputbox("Name of reader?")
    Do While reader <> ""
      newReaders(n) = reader
      reader = Inputbox("Name of reader?")
      n = n + 1
    Loop
    form.Readers = newReaders