以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  这个代码有啥不对?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=53988)

--  作者:blackzhu
--  发布时间:2014/7/19 13:16:00
--  这个代码有啥不对?
Dim Val As Double

Dim MyHMNames() As Double ={"号码_1","号码_2","号码_3","号码_4","号码_5","号码_6","号码_7","号码_8","号码_9","号码_10","号码_11","号码_12","号码_13","号码_14","号码_15","号码_16","号码_17","号码_18","号码_19","号码_20","号码_21","号码_22","号码_23","号码_24","号码_25","号码_26","号码_27","号码_28","号码_29","号码_30","号码_31","号码_32","号码_33","号码_34","号码_35","号码_36"}
Dim myPLNames() As Double ={"赔率_1","赔率_2","赔率_3","赔率_4","赔率_5","赔率_6","赔率_7","赔率_8","赔率_9","赔率_10","赔率_11","赔率_12","赔率_13","赔率_14","赔率_15","赔率_16","赔率_17","赔率_18","赔率_19","赔率_20","赔率_21","赔率_22","赔率_23","赔率_24","赔率_25","赔率_26","赔率_27","赔率_28","赔率_29","赔率_30","赔率_31","赔率_32","赔率_33","赔率_34","赔率_35","赔率_36"}
Dim MyHSNames() As Double ={"回水_1","回水_2","回水_3","回水_4","回水_5","回水_6","回水_7","回水_8","回水_9","回水_10","回水_11","回水_12","回水_13","回水_14","回水_15","回水_16","回水_17","回水_18","回水_19","回水_20","回水_21","回水_22","回水_23","回水_24","回水_25","回水_26","回水_27","回水_28","回水_29","回水_30","回水_31","回水_32","回水_33","回水_34","回水_35","回水_36"}
For i As Integer = 0 To MyHMNames.Length -1
    Val = Val + MyHMNames(i) * MyHSNames(i)
Next
Output.Show(Val)


  提示:


---------------------------
版本:2014.7.19.1
---------------------------
代码执行出错,错误信息:



System.InvalidCastException: 从字符串“号码_1”到类型“Double”的转换无效。 ---> System.FormatException: 输入字符串的格式不正确。

   在 Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)

   在 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)

   --- 内部异常堆栈跟踪的结尾 ---

   在 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)

   在 Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value)

   在 UserCode.Test()
---------------------------
确定   
---------------------------


--  作者:blackzhu
--  发布时间:2014/7/19 13:21:00
--  
我想错了,知道怎么回事了!