Dim i as integer Dim x as float

  • Slides: 19
Download presentation

二 變數: 需宣告 (例如以下例) Dim i as integer Dim x as float Dim y

二 變數: 需宣告 (例如以下例) Dim i as integer Dim x as float Dim y as double Dim dd as date Dim s 1 as string Dim s 2 as string*80 Dim A(10, 15) as Integer const pi = 3. 141593 Variant 不限型態

(3) Nested If If ( ) Then. Else. If. Else. End If

(3) Nested If If ( ) Then. Else. If. Else. End If

(4) Select Dim id as integer Select case id case 1: . case else.

(4) Select Dim id as integer Select case id case 1: . case else. End Select

四 迴圈 Loop (i) For …. . Next For I=1 To 10 Print I

四 迴圈 Loop (i) For …. . Next For I=1 To 10 Print I Next I (ii) Do loop I=1 Do while I <=10 Print I I=I+1 Loop

五 迴圈 Loop (iii) While-Wend迴圈 I=1 While I <=10 Print I I=I+1 Wend

五 迴圈 Loop (iii) While-Wend迴圈 I=1 While I <=10 Print I I=I+1 Wend