自定义Max函数为:
Dim MaxVal As Single = Args(0)
For i As Integer = 1 To Args.Length - 1
MaxVal = Math.Max(MaxVal,Args(i))
Next
Return MaxVal
按以下的编码执行:
Dim t As String = "1,2,3"
Output.Show(Functions.Execute("Max",t.split(",")))
运行后出现错误的详细信息如下,这是什么问题?
.NET Framework 版本:2.0.50727.8940
Foxtable 版本:2019.4.12.1
错误所在事件:自定义函数Max
详细错误信息:
调用的目标发生了异常。
重载决策失败,必须进行收缩转换才能调用 Public“Max”:
'Public Shared Function Max(val1 As ULong, val2 As ULong) As ULong':
与参数“val1”匹配的参数从“Single”收缩到“ULong”。
与参数“val2”匹配的参数从“String”收缩到“ULong”。
'Public Shared Function Max(val1 As Long, val2 As Long) As Long':
与参数“val1”匹配的参数从“Single”收缩到“Long”。
与参数“val2”匹配的参数从“String”收缩到“Long”。
'Public Shared Function Max(val1 As Single, val2 As Single) As Single':
与参数“val2”匹配的参数从“String”收缩到“Single”。
'Public Shared Function Max(val1 As Decimal, val2 As Decimal) As Decimal':
与参数“val1”匹配的参数从“Single”收缩到“Decimal”。
与参数“val2”匹配的参数从“String”收缩到“Decimal”。
'Public Shared Function Max(val1 As Double, val2 As Double) As Double':
与参数“val2”匹配的参数从“String”收缩到“Double”。
'Public Shared Function Max(val1 As UInteger, val2 As UInteger) As UInteger':
与参数“val1”匹配的参数从“Single”收缩到“UInteger”。
与参数“val2”匹配的参数从“String”收缩到“UInteger”。
'Public Shared Function Max(val1 As Byte, val2 As Byte) As Byte':
与参数“val1”匹配的参数从“Single”收缩到“Byte”。
与参数“val2”匹配的参数从“String”收缩到“Byte”。
'Public Shared Function Max(val1 As SByte, val2 As SByte) As SByte':
与参数“val1”匹配的参数从“Single”收缩到“SByte”。
与参数“val2”匹配的参数从“String”收缩到“SByte”。
'Public Shared Function Max(val1 As Short, val2 As Short) As Short':
与参数“val1”匹配的参数从“Single”收缩到“Short”。
与参数“val2”匹配的参数从“String”收缩到“Short”。
'Public Shared Function Max(val1 As Integer, val2 As Integer) As Integer':
与参数“val1”匹配的参数从“Single”收缩到“Integer”。
与参数“val2”匹配的参数从“String”收缩到“Integer”。
'Public Shared Function Max(val1 As UShort, val2 As UShort) As UShort':
与参数“val1”匹配的参数从“Single”收缩到“UShort”。
与参数“val2”匹配的参数从“String”收缩到“UShort”。