1 / 7

Visual Basic 6 変数

Visual Basic 6 変数. 変数を利用した プログラムの作成方法. 目次. 変数とは? 変数の宣言方法 変数を利用したプログラムの例 変数の操作方法 次の結果はどうなりますか?. 変数とは. 変数は値を一時的に保存しておく場所 名前のついている箱 値を 代入 することができる kekka = 100 moji = “ こんにちは” 値を取り出すこともできる Text1.Text = kekka MsgBox (moji) 変数を利用するためにはあらかじめ 宣言する (定義する)必要がある. kekka. moji. 100. こんにちは.

Télécharger la présentation

Visual Basic 6 変数

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Basic 6変数 変数を利用した プログラムの作成方法

  2. 目次 • 変数とは? • 変数の宣言方法 • 変数を利用したプログラムの例 • 変数の操作方法 • 次の結果はどうなりますか?

  3. 変数とは • 変数は値を一時的に保存しておく場所 • 名前のついている箱 • 値を代入することができるkekka = 100moji = “こんにちは” • 値を取り出すこともできるText1.Text = kekkaMsgBox (moji) • 変数を利用するためにはあらかじめ宣言する(定義する)必要がある kekka moji 100 こんにちは 代入 代入 kekka moji 代入 Kekka = 100

  4. 変数の宣言方法 • 変数は次のように宣言するDim 変数名 As データ型 • 例:整数を格納できる変数「kekka」を宣言Dim kekka As Integer • 例:文字を格納できる変数「moji」を宣言Dim moji As String • データ型 • 変数に格納できるデータ(値)の種類 • 文字型(String)、整数型(Integer)、日付型(Date)、長整数型(Long)、浮動小数点型(Double)など

  5. 変数を利用したプログラムの例

  6. 変数の操作方法 • 変数の中に、現在どのような値が入っているかわからない状態で、次のような計算処理をする場合 • 変数「kekka」に入っている値に50足したいkekka = kekka + 50 • 変数「kekka」に入っている値を10倍したいkekka = kekka * 10 代入 代入

  7. 次の結果はどうなりますか? ① ②

More Related