Visual.Basic文法基礎之二

來源:互聯網
上載者:User

標籤:visual basic

1、顯示聲明: Option Explicit

2、常量: Const 常量名 As 資料類型 = 值

3、變數:

Dim|Private|Public 變數名 As 資料類型

Dim 變數名 As String*n

4、數組:

------------------------------------------------------------------------------------------------------

Dim|Private|Public 數組名(n) As 資料類型(下標值:0~n)

Dim|Private|Public 數組名(m To n) As 資料類型(下標值:m~n)

------------------------------------------------------------------------------------------------------

Dim 數組名() As 資料類型

ReDim 數組名(n)

------------------------------------------------------------------------------------------------------

Dim 變數名 As Variant

變數名 = Array(常量1, ...)

變數名(1)的值為“常量1”[以此類推]

------------------------------------------------------------------------------------------------------

choose(變數名, 常量1, ...)

變數值為1時返回“常量1”[以此類推]

------------------------------------------------------------------------------------------------------

5、結構體:

Private|Public Type 結構體名

    成員名 As 資料類型

    ...

End Type

------------------------------------------------------------------------------------------------------

Dim|Private|Public 變數名 As 結構體名

變數名.成員名

Dim|Private|Public 數組名(n) As 結構體名

數組名(n).成員名

------------------------------------------------------------------------------------------------------

本文出自 “frank_zfh” 部落格,請務必保留此出處http://zengfanhong.blog.51cto.com/8894077/1885573

Visual.Basic文法基礎之二

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.