Search code examples
vbalistlotus-dominolotusscript

How to use Lotusscript Lists to store number of forms in a collection?


I have a collection of documents with different forms and need to store number of document forms in a list, the listtag would be the form name and the value how many occurances of that form was in the collection, like so:

Form Main = 20

Form Doc = 10

The following code is a start of what I am trying to do, but I need to increment the value of the element each time a new doc with an existing form take place

Dim frmList List As integer
Set ud = newdc.Getfirstdocument()
Do Until ud Is Nothing
            frm = ud.Form(0)
            If(IsElement(frmList(frm))) Then
                frmList(frm) =  1 ' Need to increment this value with 1 if tag exist
            Else
                frmList(frm) = 1 
            End If
            Set ud = newdc.Getnextdocument(ud)  
        Loop

if this is not possible using "lists", I need another solution

thanks

Thomas


Solution

  • Just write

    frmList(frm) =  frmList(frm) + 1 
    

    frmList(frm) gives you the current number for a form. Just increment it by one and set the new value.