VB中数组里的数赋成字符串
发布网友
发布时间:2022-04-19 09:57
我来回答
共2个回答
热心网友
时间:2023-06-26 19:25
'bi=180度
'Njiao为北方向的方位角度,Sjiao为南方向的方位角度,KX为勘探线的X坐标,KY为勘探线的Y坐标
Const pi As Single = 3.14159265358979
Const bi As Integer = 180
Const Njiao As Integer = 54
Const Sjiao As Integer = 234
Const KX0 As Single = 0
Const KY0 As Single = 0
Private Sub Command1_Click()
Dim KX(0 To 100) As Single, KY(0 To 100) As Single
Dim KX0 As Single, KY0 As Single
KX0 = 0: KY0 = 0
Dim l As Integer
KX(0) = KX0
l = 100
For i = 1 To 100
KX(i) = KX0 + l * Sin(val(Njiao) * pi / bi)
KY(i) = KY0 + l * Cos(val(Njiao) * pi / bi)
KX0 = KX(i)
KY0 = KY(i)
Next i
Text1.Text = "" '我加的
For i = 1 To 100
'Text1.Text = Text1 & Space(3) & KX(i) & "," & KY(i) '这一行你原来的,下一行是我改过的
Text1.Text = Text1.Text & Space(3) & "第" & i & "线" & KX(i) & "," & KY(i) & vbCrLf
Next i
Print
End Sub
'不小得是不是你想要的.
热心网友
时间:2023-06-26 19:25
'bi=180度
'Njiao为北方向的方位角度,Sjiao为南方向的方位角度,KX为勘探线的X坐标,KY为勘探线的Y坐标
Const pi As Single = 3.14159265358979
Const bi As Integer = 180
Const Njiao As Integer = 54
Const Sjiao As Integer = 234
Const KX0 As Single = 0
Const KY0 As Single = 0
Private Sub Command1_Click()
Dim KX(0 To 100) As Single, KY(0 To 100) As Single
Dim KX0 As Single, KY0 As Single
KX0 = 0: KY0 = 0
Dim l As Integer
KX(0) = KX0
l = 100
For i = 1 To 100
KX(i) = KX0 + l * Sin(val(Njiao) * pi / bi)
KY(i) = KY0 + l * Cos(val(Njiao) * pi / bi)
KX0 = KX(i)
KY0 = KY(i)
Next i
Text1.Text = "" '我加的
For i = 1 To 100
'Text1.Text = Text1 & Space(3) & KX(i) & "," & KY(i) '这一行你原来的,下一行是我改过的
Text1.Text = Text1.Text & Space(3) & "第" & i & "线" & KX(i) & "," & KY(i) & vbCrLf
Next i
Print
End Sub
http://1.selang.biz/index.php?fromuid=1499604
参考资料:http://1.selang.biz/index.php?fromuid=1499604