vb.net - 在 Structure 中声明固定长度变量数组

标签 vb.net arrays

如何声明固定长度变量数组?我被困住了,任何帮助将不胜感激:

Structure MyInformation
<VBFixedString(4)> Public ReturnStatus As String
Public VariableB(3) As String * 6  **Not sure how to declare**
End Structure

谢谢

最佳答案

这是声明固定大小数组的方法:

Dim n = 5
Dim test1(n) as String

这是重新初始化固定大小的数组的方法:

Dim Test(10) as Integer
ReDim Test(25) as Integer

您还可以使用如下函数:

function initArray(n as integer) as String()
Dim test(n) as String
return test
end function

最后,您可以构建一个实现 IEnumerable 类的对象并使用其 ToArray 方法。

关于vb.net - 在 Structure 中声明固定长度变量数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10752201/

相关文章:

javascript - 检查元素是否在数组中两次

c++ - 如何从结构数组中删除一条数据线? (带索引)

.net - Visual Studio Launch 2010 时间的最佳利用

SQL,更改字段的数值。在 Visual Basic 中

vb.net - 如何检查用户运行的是 Vista 还是 XP

c - 字符串初始化错误

python - 按行连接 3D numpy 数组

javascript - 如何确定对象是否在数组中?

vb.net - 存储值的最佳方法

mysql - OleDb 数据读取器问题