问题比较拗口,文字解释:父Dictionary中有n个键,每一个键索引一个数组A,数组A由两个元素组成:一个小的子Dictionary和一个Integer数值;而这个子Dictionary的每一个键都索引一个行向量的数组。
我简单图解一个:整个Dictionary变量是如下组织的:用 { } 表示Dictionary的框架,用 [ ] 表示数组的框架。
父Dictionary_P { Key01 : [ 子Dictionary _S { Key11 : [ 行向量数据 V11 ] } , 一个Integer值]
[ 行向量数据 V12 ] } , 一个Integer值]
[ 行向量数据 V13 ] } , 一个Integer值] }
Key02 : [ 子Dictionary { Key12 : [ 行向量数据 V21 ] } , 一个Integer值]
[ 行向量数据 V22 ] } , 一个Integer值]
[ 行向量数据 V23 ] } , 一个Integer值] }
Key03 : [ 子Dictionary { Key13 : [ 行向量数据 V31 ] } , 一个Integer值]
... }
现在出现的问题是:当对数组V11中的元素赋值时,V12、V13等数组中相同位置的数据都发生了同步的变化,变成了同一个值。
图解如下:

代码如下:重点在父字典与子字典的定义与赋值的位置,我均作了标注。
各位大神帮帮忙。
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Word
Imports Microsoft.Office.Interop.Excel
Module DeriveDataFromWord
Dim DicAllData As New Dictionary(Of String, Object)
'得到Excel中定义的字典项目
'{i监测项目[ {i此项目的点号[每天的监测数据]} ,此项目的数据在Word表格中相对于测点编号单元格的偏移数据}
Dim FilesCount As Integer
Dim Excelfullname = "C:\Users\Administrator\Desktop\name.xlsx"
Dim docPath = "F:\基坑数据\b03-d\03D监测报表\监测报表"
Dim ExcelSavedFullname = "C:\Users\Administrator\Desktop\保存.xlsx"
Sub main()
Dim fs As Object
fs = CreateObject("scripting.filesystemobject")
Dim docfiles = fs.getfolder(docPath).Files
'排除文件夹中的缓存文件,并提取出日期数组
Dim arrDate() As Date
ReDim arrDate(0 To docfiles.Count - 1)