vb鏁扮粍闂
鎴戝湪鏁扮粍涓瓨鍏ヤ簡涓ょ鏁版嵁锛屾暟鍊煎瀷number = Mid(TextBox1.Text, j, i - j) '鍙栧嚭涓€娈靛瓧绗︿覆
box(boxno) = Val(number) '灏嗗彇鍑哄瓧绗︿覆璁″叆box涓?br />
鍜屽瓧绗︿覆鍨?br /> box(boxno) = Mid(TextBox1.Text, i + 1, 1)
鐜板湪鎴戣鍒ゆ柇瀛楃鍨嬫暟鎹殑浣嶇疆锛岃鎬庝箞鍔烇紵鎴戠敤涓嬮潰鐨勬柟娉曪細
If box(i) = ")" Then
鈥︹€︹€︹€︹€︹€︹€︹€?br />
vb鑰佹槸璇翠笉鑳藉湪string鍜宒ouble涔嬮棿杞崲锛堟垜瑙夊緱鏄痓ox涓瓨浜?涓暟鎹紝鑰屽垽鏂潯浠跺彧鑰冭檻浜嗗瓧绗﹀瀷锛夈€傛垜璇ユ€庝箞鍔?
鎴戝彧鎯虫壘鍒板瓧绗﹀瀷鏁版嵁鎵€鍦ㄤ綅缃紙鍗砨oxno锛夛紝鍒ゆ柇鏉′欢鎬庝箞灏嗘暟缁勪腑鐨刣ouble鍨嬫暟鎹繃婊ゆ帀? 涓嶈浣跨敤涓ょ绫诲瀷锛?br />
dim Box() as string
redim Box(n)
鎴栬€咃細
dim Box(m) as string 閮藉綋涓插鐞嗭紝闇€瑕佽绠楁椂锛屽啀杞崲鎴愭暟瀛椼€? box瀹氫箟鎴恦arant,鍦ㄤ娇鐢ㄦ槸鐢↖snumeric鍒ゆ柇涓?br />
Dim a, b, c
a = Val("123")
b = "1234"
c = "abc"
Debug.Print IsNumeric(a)'true
Debug.Print IsNumeric(b)'true
Debug.Print IsNumeric(c)'false
IsNumeric 閮藉綋瀛楃澶勭悊锛岄渶瑕佽绠楁椂锛屽啀杞崲鎴愭暟瀛椼€? ...杩欑璁捐寰堣泲鐤? 鍙堟斁鍐呭鍙堟斁鏁板瓧, 鑷繁涔熷緢瀹规槗鎼為敊.
姝g‘鐨勫仛娉曟槸瀹炵敤鑷畾涔夋暟鎹被鍨?
TYPE MyRecord
Content as string '杩欎釜瀛樻斁瑕佹煡鎵剧殑鍐呭
Position as long '杩欎釜瀛樻斁鍐呭鐨勮捣濮嬩綅缃?br /> End TYPE
瀹炵敤鐨勬椂鍊欏涓嬪畾涔?
DIM AAA(100) AS MyRecord
...
鐒跺悗灏辨槸
With AAA(0)
.Content= Text1.text
.Positoin= Mid(.Content, j, i - j)
End With
杩欐槸澶氫箞浼橀泤鑰屽張寮哄.鐨勪唬鐮佸憖.