宣告變數時可能犯的錯誤
1. Dim a,b,c As Integer ' a,b 為Variant,c 為Integer
2. Dim a As Integer,b As Integer,c as Integer ' a,b,c皆為Integer
一般初學者很容易將 "2" 的語法寫成 "1",其原因可能是早期的程式語言把兩者視為相同(ex. Fortran),甚至 "x林書局" 出的一本書(VB4),都用 "1" 的語法。這種錯誤雖不會造成程式終止,但對於大程式來說,無形中卻浪費了不少記憶體。
This page was written by Jaric on Sep. 20 , 1997. All rights reserved.