Page 33 - ePB316_最佳案例 Visual Basic 2017 程式設計
P. 33
Chapter 02 │基本語法
ɓeܸݼ༶ၑɿAssignment operator
ܸݼא၈ܸ֛༶ၑɿٙୌމ =̥Ϟ Pascal ၾ Delphi મ ͜j=d Չ
Ъ͜މਗ਼༶ၑୌ̛ᗙ༶ၑόٙ࠽ܸݼഗ༶ၑୌ̸ᗙٙ༶ၑʩfה˸d˸ɨાࠑ
sum = a + bd݊ਗ਼ a + b ٙ࠽ܸݼഗ sumf
sum = 0 : a = 3 : b = 5 ' ΝɓБʫϞεࡈાࠑࣛdც˸ڽஹટ
sum = a + b
ɪόၾᅰኪٙഃ݊ʔΝٙdה˸ʔࠅɓٜᕿဲމʡჿ 0 ึഃ 8fՉϣdЫʔঐਗ਼
੬ᅰ׳ίܸݼ༶ၑɿ̸ٙᗙfԷνj
8 = x
މɓࡈʔΥجٙાࠑdШ˸ɨાࠑਗ਼੬ᅰ 8 ܸݼഗᜊᅰ x މΥجٙf
x = 8
˸ɨાࠑ
a=a+1
ۆ݊ਗ਼ᜊᅰ a ʘ࠽՟̈d̋ɓdΎܸݼΫ afה˸ a ʘ࠽݊ 4f
ɚeၑஔ༶ၑɿArithmetic operators
ၑஔ༶ၑɿ͜ԸੂБɓছٙᅰ ༶ၑɿୌ ̌ঐ ᇍԷ ഐ؈
ኪ༶ၑdܼ̍՟͍ᅰ+e՟ࠋᅰ + ՟͍ᅰ +2
– ՟ࠋᅰ –3
–e̋+eಯ–e࠱*e
+ ̋ 6 + 2 8
ৰ/eᅰৰج\eϣ˙^
– ಯ 6 – 2 4
ʿ՟ቱᅰModഃdν̛ڌהͪf * ࠱ 6 * 2 12
/ ৰ 7 / 2 3.5
\ ᅰৰج 7 \ 2 3
^ ϣ˙ 3^2 9
Mod ՟ቱᅰ 6 Mod 3 0
25