タイトル | : 多次元配列構造体の値代入 |
記事No | : 7289 |
投稿日 | : 2008/04/10(Thu) 10:31 |
投稿者 | : Y開発者 |
多次元配列構造体で、値を代入すると他の次元の変数値まで、変わってしまいます。 構造体の定義、変数の定義などの仕方に問題があるのでしょうか? 御存じの方がいらっしゃいましたら、ご教授頂けないでしょうか。 宜しくおねがいします。
【環境】 Windows XP Pro Microsoft Visual Basic 2005 .NET Framework2.0.50727
Public Structure wGData Dim wKM_1 As Double Dim wKM_2 As Double Dim wKM_3 As Double Dim wKM_4 As Short Dim wKM_5 As Integer Dim wKM_6 As String Dim wKM_7 As String Dim wKM_8 As Integer Dim wKM_9 As Integer Dim wKM_10 As Integer Dim wKM_11 As Short Dim wKM_12 As Single Dim wKM_13 As Single Dim wKM_14 As Single Dim wKM_15 As Byte Dim wKM_16 As Integer Dim wKM_17 As Integer Dim wKM_18 As Byte Dim wKM_19 As Byte Dim wKM_20 As Byte Dim wKM_21 As Byte Dim wKM_22 As Double Dim wKM_23 As Double Dim wKM_24 As Double Dim wKM_25 As Double Dim wKM_26 As Double Dim wKM_27 As Double Dim wKM_28 As Double Dim wKM_29 As Double Dim wKM_30 As Double Dim wKM_31 As Double Dim wKM_32 As Double Dim wKM_33 As Double Dim wKM_34 As Double Dim wKM_35 As Double Dim wKM_36 As Double Dim wKM_37 As Double Dim wKM_38 As Double Dim wKM_39 As Double Dim wKM_40 As Double Dim wKM_41 As Double Dim wKM_42 As Double Dim wKM_43 As Double Dim wKM_44 As Double Dim wKM_45 As Double Dim wKM_46 As Double Dim wKM_47 As Double Dim wKM_48 As Double Dim wKM_49 As Double Dim wKM_50 As Double Dim wKM_51 As Double Dim wKM_52 As Double Dim wKM_53 As Double Dim wKM_54 As Double Dim wKM_55 As Double Dim wKM_56 As Double Dim wKM_57 As Double Dim wKM_58 As Double Dim wKM_59 As Double Dim wKM_60 As Double Dim wKM_61 As Double Dim wKM_62 As Double Dim wKM_63 As Double Dim wKM_64 As Double Dim wKM_65 As Double Dim wKM_66 As Double Dim wKM_67 As Double Dim wKM_68 As Double End Structure
Public Sub Test_Sub() Dim wAnswer As Double Dim wA(,) As wGData
ReDim wA(0, 1)
wAnswer = wA(0, 1).wKM_2 ' wAnswer = 0
wA(0, 0).wKM_45 = 100
wAnswer = wA(0, 0).wKM_45 ' wAnswer = 100 wAnswer = wA(0, 1).wKM_2 ' wAnswer = 100 代入してないのに、値が変わる
End Sub
|