Lotus Notes:Print/write variant() 到 freefile() .csv

Lotus Notes: Print/write variant() to freefile() .csv

我只想问一下如何将 variant() 打印出来 --> "tmpArray" 到 .csv?因为在我现在的代码中,它只访问数组中的第一个值。我想访问数组中的所有值并将其打印在 .csv 文件中。下面是我的代码。将不胜感激 suggestions/help。谢谢

例如我有 3 个相同值的文档。

tmpArray3(0) = 2,999
tmpArray3(1) = 4,999
tmpArray4(0) = 1,000
tmpArray4(1) = 5,903

第一个文档正在打印的是:2,999 和 1,000。 为第二份文件打印的是:2,999 和 1,000。 正在为第 3 个文档打印的是:2,999 和 1,000。

它没有继续处理变体数组中的第二个值。

 Do While doccount1 < 11 AND Not v2entry Is Nothing

            ReDim Preserve tmpArray3(tmpcount3)
            ReDim Preserve tmpArray4(tmpcount4)

            tmpArray3(tmpcount3) = v2entry.ColumnValues(3)
            tmpArray4(tmpcount4) = v2entry.ColumnValues(4)
           

            doccount1 = doccount1 + 1

            tmpcount3=tmpcount3 + 1
            tmpcount4=tmpcount4 + 1
         

            Print #datafileNum%,(tmpArray3(0) & ";" & tmpArray4(0))
            Set v2entry = vc.GetNextEntry(v2entry)

        Loop
    Next
    Close datafileNum%
    Exit Sub

一个问题是,在您的 Print 语句中,您正在访问 tmpArray3 和 tmpArray4 数组的第一个索引(即索引 0)。您需要在其中放置一个变量。

例如:

 Do While doccount1 < 11 AND Not v2entry Is Nothing

            ReDim Preserve tmpArray3(tmpcount3)
            ReDim Preserve tmpArray4(tmpcount4)

            tmpArray3(tmpcount3) = v2entry.ColumnValues(3)
            tmpArray4(tmpcount4) = v2entry.ColumnValues(4)
           

            doccount1 = doccount1 + 1
                       

            Print #datafileNum%,(tmpArray3(tmpcount3) & ";" & tmpArray4(tmpcount4))
            Set v2entry = vc.GetNextEntry(v2entry)

            tmpcount3=tmpcount3 + 1
            tmpcount4=tmpcount4 + 1

        Loop
    Next
    Close datafileNum%
    Exit Sub

但是,您也总是从 v2entry.ColumnValues() 中检索索引 3 和 4。我假设你也想用一个变量替换 3 和 4