[英]Visual Basic: How can I have an integer in a variable?
如果問題有點乏味,我道歉,但我要做的是從“R1”,“R2”,“R3”等文本文件中訪問一系列內容。 我可以將該名稱中的整數作為單獨的變量嗎?
所以如果我......
Dim R0 As String = "Hello"
Dim R1 As String = "Goodbye"
Dim RCount As Integer = 0
MsgBox(R & RCount) 'Returns Hello
並非沒有創建和評估表達式樹 ,但您可以使用數組和索引到數組中。
Dim R(6) as String
R(0) = "Hello"
R(1) = "Goodbye"
Dim RCount as Integer = 0
MsgBox(R(RCount))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.