📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "main()"
ClientHeight = 4065
ClientLeft = 60
ClientTop = 345
ClientWidth = 2655
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4065
ScaleWidth = 2655
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command5
Caption = "退出/Exit"
Height = 495
Left = 360
TabIndex = 4
Top = 3240
Width = 1935
End
Begin VB.CommandButton Command4
Caption = "查看/输出结果"
Height = 495
Left = 360
TabIndex = 3
Top = 2520
Width = 1935
End
Begin VB.CommandButton Command3
Caption = "数据检查"
Height = 495
Left = 360
TabIndex = 2
Top = 1800
Width = 1935
End
Begin VB.CommandButton Command2
Caption = "开始计算"
Height = 495
Left = 360
TabIndex = 1
Top = 720
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "介绍使用"
Height = 495
Left = 360
TabIndex = 0
Top = 360
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End Sub
Private Sub Command2_Click()
dotjetzt = dotstart
re: dotende = Val(InputBox("所参与计算的点的数目是", "数目统计"))
If dotende - dotstart < 2 Then GoTo re
fsthch = Val(InputBox("起点高程"))
lsthch = Val(InputBox("终点高程"))
xg = False
Form2.Show
End Sub
Private Sub Command3_Click()
a = MsgBox("如果你确信你的输入没有错误,可以跳过这一步,直接查看结果,你确信要检查吗?", vbYesNo, "warning")
If a = vbYes Then
xg = True
dotjetzt = dotstart
Form2.Command2.Visible = False
Form2.Command1.Enabled = False
Form2.Command3.Visible = True
Form2.Command4.Visible = True
Form2.Command4.Enabled = False
Form2.Show
Else: Command4_Click
End If
End Sub
Private Sub Command4_Click()
Dim j As Integer
sum_of_dotdis = sumdotdis
sum_of_deltah = sumdeltah
tolerance = (lsthch - fsthch - sum_of_deltah) / sum_of_dotdis
dothigh(1) = fsthch
For j = dotstart + 1 To dotende
gzs(j) = dotdistance(j) * tolerance
dothigh(j) = dothoch(j) + tolerance * dotdistance(j) + dothigh(j - 1)
Next j
Dim xh As String
Dim dg As String
xh = InputBox("线号", "线号")
dg = InputBox("等级", "等级")
Open "out.htm" For Output As #1
Print #1, "<html>"
Print #1, "<head>"
Print #1, "<title>计算结果输出</title>"
Print #1, "</head>"
Print #1, "<body>"
Print #1, "<table border='0' width='100%'>"
Print #1, "<tr>"
Print #1, "<td width='50%'align='center'>线号:", xh, "</td>"
Print #1, "<td width='50%'align='center'>等级:"; dg; "</td>"
Print #1, " </tr>"
Print #1, "</table>"
Print #1, "<table border='0' width='100%'>"
Print #1, "<tr>"
Print #1, "<td width='5%'></td>"
Print #1, "<td>"
Print #1, "<table border='1' width='100%'>"
Print #1, "<tr>"
Print #1, "<td width=20% align='center'>点 号</td>"
Print #1, "<td width=20% align='center'>高 差(M)</td>"
Print #1, "<td width=20% align='center'>距 离(km)</td>"
Print #1, "<td width=20% align='center'>改正数(mm)</td>"
Print #1, "<td width=20% align='center'>高 程(M)</td>"
Print #1,
Print #1, "</tr>"
For j = dotstart To dotende
Print #1, "<tr>"
Print #1, "<td width=20% align='center'>"; dotname(j); "</td>"
Print #1, "<td width=20% align='center'>"; dothoch(j); "</td>"
Print #1, "<td width=20% align='center'>"; dotdistance(j); "</td>"
Print #1, "<td width=20% align='center'>"; gzs(j) * 1000; "</td>"
Print #1, "<td width=20% align='center'>"; dothigh(j); "</td>"
Print #1, "</tr>"
Next j
Print #1, "</table>"
Print #1, "<table border='0' width='100%'>"
Print #1, "<tr>"
Print #1, "<td width=20% align='center'></td>"
Print #1, "<td width=20% align='center'>"; sum_of_deltah; "</td>"
Print #1, "<td width=20% align='center'>"; sum_of_dotdis; "</td>"
Print #1, "<td width=20% align='center'>"; tolerance * sum_of_dotdis; "</td>"
Print #1, "<td width=20% align='center'>"; dothigh(j); "</td>"
Print #1, "</tr>"
Print #1, "</table>"
Print #1, "</td></tr><td width='5%'></td></table>"
Print #1, "</body>"
Print #1, "</html>"
Close #1
'Shell ("out.htm")
'c:\program files\internet explorer\iexlpore.exe
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Form_Load()
dotstart = 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -