掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
二次元配列の初期値設定 (ID:110811)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> Dim table ( 0,0 to 9,9 ) > という風に10*10の二次元配列を設定したのですが、 それは2次元配列ではなく、「3次元配列」ですよ。 > C言語なら > table[0][] = { 0,1,2,3,4,5,6,7,8,9 } > という風にできるのですが、 いわゆる「ジャグ配列」の形式でも構わないなら、 Dim table(1, 2) As Variant table(0, 0) = "0-0" table(0, 1) = "0-1" table(0, 2) = "0-2" table(1, 0) = "1-0" table(1, 1) = "1-1" table(1, 2) = "1-2" MsgBox table(0, 2) の替わりに、 Dim table(1) As Variant table(0) = Array("0-0", "0-1", "0-2") table(1) = Array("1-0", "1-1", "1-2") MsgBox table(0)(2) のように書く事ができます。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.