2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C#erのためのVBチートシート(俺々版)

Posted at

例えば学校で習わされてる辛い人とか見ればいいと思う
俺とか俺とか俺とか
赤四角でエラー出てるけど気にしない
なお、自分はVB嫌いなのでVB好きな人は見ないこと

  • コメント
'The cake is a lie...
  • 変数宣言
Dim 変数名 As 型名
Dim 変数名A, 変数名B As 型名 '複数同時宣言
Dim 変数名 As 型名 = 値 '宣言と初期化 複数同時宣言かつ初期化はできない?
Dim 変数名 = 値 'var
  • if文
If 条件式 Then 真単一実行文 Else 偽単一実行文 '単一行 Elseを含んだ以降は省略可

If 条件式 Then '複数行
    実行文
ElseIf 条件式 Then
    実行文
Else
    実行文
End If
  • while文
Do While 条件式 'WhileじゃなくてUntilでもいい
    実行文
    Continue Do 'continue
    Exit Do 'break
Loop
  • do-while文
Do
    実行文
Loop While 条件式 'こっちもUntil使える
  • for文
For Dim カウンタ変数 = 0 To 4 '4になるまで
    実行文 '5回処理される
    Exit For 'break
    Continue For 'continue
Next カウンタ変数 '最後の変数指定は省略可
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?