home *** CD-ROM | disk | FTP | other *** search
Null Bytes Alternating | 1996-12-18 | 4.7 KB | 99 lines |
- '++LotusScript Development Environment:2:5:(Options):0:74
- Option Public
-
-
-
- '++LotusScript Development Environment:2:5:(Forward):0:1
- Declare Function MainTableOfRepPanel(FNAME As String, RP As REPEATINGPANEL) As Integer
- Declare Sub DupChoices
-
- '++LotusScript Development Environment:2:5:(Declarations):0:10
- Dim QuestionName As String
- Dim QesRespName As String
-
- '++LotusScript Development Environment:2:1:MainTableOfRepPanel:1:8
- Function MainTableOfRepPanel(FNAME As String, RP As REPEATINGPANEL) As Integer
- FNAME = ""
- Dim N As Integer
- N = -1
- Dim FILENAME As String
- Dim D As DOCUMENT
- Set D = CURRENTDOCUMENT
- Dim BC As BASECOLLECTION
- Set BC = D.TABLES
- FNAME = RP.MAINTABLE
- N = Instr(FNAME,":")
- If Not N = 0 Then FNAME = Left$(FNAME,N-1)
-
- Forall T In BC
- Set TBL = T
- FILENAME = TBL.FILENAME
- N = Instr(FILENAME,".")
- If Not N = 0 Then FILENAME = Left$(FILENAME,N-1)
- N = Strcompare(FNAME,FILENAME)
-
- If N = 0 Then
- FNAME = TBL.FULLNAME
- Goto OUT
- End If
-
-
- End Forall
-
-
- OUT:
- If N = 0 Then
- MainTableOfRepPanel = True
- Else
- MainTableOfRepPanel = False
- End If
- End Function
- '++LotusScript Development Environment:2:2:DupChoices:1:8
- Sub DupChoices
- Dim RS As New ResultSet
- Dim aryTemp() As String
- Dim intTotDups%, c%, j As Integer
- Dim CurPanel As Panel
- Dim strQuestNum As String
- Dim tblChoices As table
-
- 'Run this subroutine only in this particular view:
- If CurrentView.Name = "Create Questions" Then
-
- CurrentWindow.Refresh
- 'Get the current question number:
- Set CurPanel = CurrentView.body
- strQuestNum = CurPanel.Question~ Number.Text
- Set tblChoices = CurrentDocument.Gettablebyname("Choices:1")
- Set RS = tblChoices.CreateResultset
-
- 'Get the values to be duplicated first:
- Redim aryTemp (1 To RS.NumRows, 1 To 2)
- j = 1
- For c = 1 To RS.NumRows
- If RS.GetValue(1) = strQuestNum Then
- 'Put it into the temp array
- aryTemp(j,1) = RS.GetValue(2)
- aryTemp(j, 2) = RS.GetValue(3)
- j= j + 1
- End If
- RS.NextRow
- Next
- 'Close the resultset when finished
- RS.Close
-
- intTotDups = j
-
- 'Now new record:
- CurrentWindow.NewRecord
- 'Set focus to the repeating panel:
- currentwindow.tabto(3)
- For c = 1 To intTotDups
- currentwindow.newrecord
- CurrentView.RepeatingPanel.Choice.text =aryTemp(c,1)
- CurrentView.RepeatingPanel.Choice~ Description.text =aryTemp(c,2)
- Next
- Sendkeys "~", 0
- End If
-
- End Sub