06.08.2013 Views

03 林家民

03 林家民

03 林家民

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

題目說明:用一維陣列設計一個可用來輸入及查詢程式語言成績的程式<br />

檔案名稱:<strong>03</strong> \ ch7 \ P.229<br />

表單:<br />

程式碼:<br />

Dim A(1 To 50) As Integer<br />

Private Sub Command1_Click()<br />

Dim i As Integer<br />

i = Text1.Text<br />

A(i) = Text2.Text<br />

Text1 = ""<br />

Text2 = ""<br />

Text1.SetFocus<br />

End Sub<br />

Private Sub Command2_Click()<br />

j = Text1.Text<br />

i = j<br />

Text2.Text = A(i)<br />

End Sub<br />

執行結果:ex.輸入座號 3 成績 80 , 輸入 3 按查詢

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!