Tag: dijkstra

重用函数的数组

我有两个不同的function,需要访问相同的数组(该数组不是一个常数,它将被编辑,并追加到该function在单元格内使用)。 我想让这个数组可用于他们两个。 该数组需要是多维的(或者是一个UDT,它可以包含多个元素,就像我在下面的代码中试过的一样),它需要能够dynamicresize。 这里有一些示例代码(编辑了一下),但它似乎没有正常工作。 Option Base 1 Private Type PathsArray Nodes() As String End Type ' Instantiate the global array Dim Paths(1 To 1) As PathsArray Function SETTWENTY() ' Increase size of the array, preserving the current elements already inside it ReDim Preserve Paths(1 To UBound(Paths) + 1) ' Make the inner array be 20 […]