Skip to content

Instantly share code, notes, and snippets.

@aoisensi
Created May 15, 2014 01:11
Show Gist options
  • Save aoisensi/570e367d258b3071a12e to your computer and use it in GitHub Desktop.
Save aoisensi/570e367d258b3071a12e to your computer and use it in GitHub Desktop.
C#erのためのVBチートシート(俺々版) ref: http://qiita.com/aoisensi/items/54ef11ccf9aa5bbb9cb5
'The cake is a lie...
Dim 変数名 As 型名
Dim 変数名A, 変数名B As 型名 '複数同時宣言
Dim 変数名 As 型名 = 値 '宣言と初期化 複数同時宣言かつ初期化はできない?
Dim 変数名 = 値 'var
If 条件式 Then 真単一実行文 Else 偽単一実行文 '単一行 Elseを含んだ以降は省略可
If 条件式 Then '複数行
実行文
ElseIf 条件式 Then
実行文
Else
実行文
End If
Do While 条件式 'WhileじゃなくてUntilでもいい
実行文
Continue Do 'continue
Exit Do 'break
Loop
Do
実行文
Loop While 条件式 'こっちもUntil使える
For Dim カウンタ変数 = 0 To 4 '4になるまで
実行文 '5回処理される
Exit For 'break
Continue For 'continue
Next カウンタ変数 '最後の変数指定は省略可
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment