Page 29 - ePB316_最佳案例 Visual Basic 2017 程式設計
P. 29
Chapter 02 │基本語法
2-3cᜊᅰၾ੬ᅰٙ܁ѓ
ɓeᜊᅰٙ܁ѓ
ᜊᅰٙ̌ঐ݊͜Ը፩ɝeஈଣʿᎷπ̮ޢٙ༟ࣘdϾᜊᅰίԴ͜˸ۃѩࠅڭ
वο Dim ʘܝ܁ѓdʑ̙Դ͜fίɓԬᔚόٙ Basic ႧԊʕdᜊᅰԨʔცࠅԫ܁ѓd
ۍɰ੭ԸɽٙѢᓔf˸ɨόɿуމᜊᅰ͊܁ѓٙܝ؈dᇜᙇኜکೌجΫᏐԴ͜٫
ίܳοɪٙ፹ႬdϾிϓৰ፹ɪٙѢᗭf
student = studend+1
˸ɪાࠑ߰ԫ܁ѓ student νɨj
Dim student As Short
ۆᇜᙇኜ༾Ց studend ࣛdکึ፴Դ͜٫Ϥ studend Ԩ͊܁ѓٙ፹Ⴌৃࢹd፴Դ
͜٫܁ѓאءจܳο፹ႬfՉϣdᜊᅰ܁ѓٙᎴᓃ̙݊ৣໄܦٙাኳϾ৷༟
ࣘٙஈଣࣖଟfԷνjϞԬᜊᅰٙ࠽ਹසމᅰdۆʔ͜܁ѓމओᓃᅰא Decimalf
ޟЇϞԬᜊᅰٙ࠽ਹʃՑԴ͜ Byte ۨйу̙ᎷπdϤ್ࣛ܁ѓމ Byte ۨйу̙f
வɰఱ݊ᜫʃ؇Г͜ʃᇌɿༀeɽ؇Г͜ɽᇌɿༀٙ༸ଣdνϤʑঐһϞࣖଟή၍
ଣাኳdϾ˲৷Չย༶ܓf
VB ᜊᅰٙ܁ѓٙᔊࠅႧجνɨj
Dim ᜊᅰΤ၈ As ༟ࣘۨй [= ڋ࠽ ]
Էνj˸ɨાࠑ̙܁ѓᜊᅰ a ٙۨйމ Shortf
Dim a As Short
˸ɨાࠑ̙܁ѓᜊᅰٙΝࣛ͵̙ഗʚڋ࠽f
Dim a as Short =34
߰ϞՇࡈ˸ɪٙᜊᅰϞΝٙۨйd͵̙Νࣛഗʚ܁ѓdШ݊ᜊᅰʘගც˸ஸ,
ཞකfԷνj˸ɨાࠑ̙Νࣛ܁ѓᜊᅰ bec ٙۨйމ Stringf
Dim b,c As String
21