帮忙翻译一段vb的代码,翻译成delphi的,是关于双曲线模型预测
Dim HTdata8(2, 10000) As DoubleDim Htdata9(2, 10000) As Double
Dim Ti As Double
Dim DATASTRING As String
Dim Gongdian As String
Dim k8 As Integer
;读入数据文件
k8 = 1
Open "AX.DAT" For Input As #18
Do Until EOF(18)
Line Input #18, DATASTRING
HTdata8(1, k8) = Val(Left(DATASTRING, 8))
HTdata8(2, k8) = Val(Mid$(DATASTRING, 9, 8))
k8 = k8 + 1
If k8 > 10000 Then Exit Do
Loop
Close #18
;数据处理
k8 = k8 - 1
For i = 2 To k8
Htdata9(1, i) = HTdata8(1, i) - HTdata8(1, 1)
Htdata9(2, i) = (HTdata8(1, i) - HTdata8(1, 1)) / (HTdata8(2, i) - HTdata8(2, 1))
Next i
Htdata9(1, 1) = 0
Htdata9(2, 1) = 0
For i = 2 To k8
Htdata9(1, 1) = Htdata9(1, 1) + Htdata9(1, i)
Htdata9(2, 1) = Htdata9(2, 1) + Htdata9(2, i)
Next i
Htdata9(1, 1) = Htdata9(1, 1) / (k8 - 1)
Htdata9(2, 1) = Htdata9(2, 1) / (k8 - 1)
ht1 = 0
ht2 = 0
For i = 2 To k8
ht1 = ht1 + (Htdata9(1, i) - Htdata9(1, 1)) * (Htdata9(2, i) - Htdata9(2, 1))
ht2 = ht2 + (Htdata9(1, i) - Htdata9(1, 1)) * (Htdata9(1, i) - Htdata9(1, 1))
Next i
;求待定参数
BB = ht1 / ht2
AA = Htdata9(2, 1) - BB * Htdata9(1, 1)
;输出参数至输出文件
Open "双曲线模型.DAT" For Output As #1
Write #1, HTdata8(1, 1)
Write #1, HTdata8(2, 1)
Write #1, AA
Write #1, BB
Close #1
r = MsgBox("计算完成,结果请查询“双曲线模型.dat” ", vbOKOnly)
End