📄 form7.frm
字号:
Height = 525
Left = 600
TabIndex = 16
Top = 240
Width = 4860
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "计算机:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4680
TabIndex = 13
Top = 2040
Width = 1320
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "C语言:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4920
TabIndex = 12
Top = 1320
Width = 1170
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "物理:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 11
Top = 4200
Width = 990
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "英语:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 10
Top = 3480
Width = 990
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "高数:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 9
Top = 2760
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 8
Top = 2040
Width = 990
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "学号:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 600
TabIndex = 7
Top = 1320
Width = 990
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
position = 1
Open "cj.dat" For Random As #1 Len = Len(recordvar)
recordnumer = LOF(1) / Len(recordvar)
xianshi
Close #1
End Sub
Private Sub 取消_Click()
Visible = False
Form2.Visible = True
Unload Form7
End Sub
Sub xianshi()
If recordnumer >= 1 Then
Get #1, position, recordvar
Text1.Text = recordvar.stnum
Text2.Text = recordvar.stname
Text3.Text = recordvar.gaoshu
Text4.Text = recordvar.yingyu
Text5.Text = recordvar.wuli
Text6.Text = recordvar.cyuyan
Text7.Text = recordvar.jisuanji
End If
End Sub
Private Sub 确定_Click()
If (Text3.Text < 0 Or Text3.Text > 100) Then
MsgBox "输入有误,请重新输入"
Text3.SetFocus
GoTo chonglai
End If
If (Text4.Text < 0 Or Text4.Text > 100) Then
MsgBox "输入有误,请重新输入"
Text4.SetFocus
GoTo chonglai
End If
If (Text5.Text < 0 Or Text5.Text > 100) Then
MsgBox "输入有误,请重新输入"
Text5.SetFocus
GoTo chonglai
End If
If (Text6.Text < 0 Or Text6.Text > 100) Then
MsgBox "输入有误,请重新输入"
Text6.SetFocus
GoTo chonglai
End If
If (Text7.Text < 0 Or Text7.Text > 100) Then
MsgBox "输入有误,请重新输入"
Text7.SetFocus
GoTo chonglai
End If
Open "cj.dat" For Random As #1 Len = Len(recordvar)
recordvar.stnum = Text1.Text
recordvar.stname = Text2.Text
recordvar.gaoshu = Text3.Text
recordvar.yingyu = Text4.Text
recordvar.wuli = Text5.Text
recordvar.cyuyan = Text6.Text
recordvar.jisuanji = Text7.Text
recordvar.average = recordvar.gaoshu * 2 + recordvar.yingyu * 2 + recordvar.wuli * 2 + recordvar.cyuyan * 1.5 + recordvar.jisuanji
Put #1, position, recordvar
paixu
Close #1
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Visible = False
Form2.Visible = True
Unload Form7
chonglai:
End Sub
Private Sub 上一个_Click()
Open "cj.dat" For Random As #1 Len = Len(recordvar)
If position > 1 Then
position = position - 1
xianshi
ElseIf position = 1 Then
MsgBox "这是第一个记录"
End If
Close #1
End Sub
Private Sub 下一个_Click()
Open "cj.dat" For Random As #1 Len = Len(recordvar)
If position < recordnumer Then
position = position + 1
xianshi
ElseIf position = recordnumer Then
MsgBox "这是最后一个记录"
End If
Close #1
End Sub
Sub paixu()
For n = 1 To recordnumer - 2
For m = 1 To recordnumer - 1
Get #1, m, recordvar1
Get #1, m + 1, recordvar2
If recordvar2.average > recordvar1.average Then
recordvar.stnum = recordvar1.stnum
recordvar.stname = recordvar1.stname
recordvar.gaoshu = recordvar1.gaoshu
recordvar.yingyu = recordvar1.yingyu
recordvar.wuli = recordvar1.wuli
recordvar.cyuyan = recordvar1.cyuyan
recordvar.jisuanji = recordvar1.jisuanji
recordvar.average = recordvar1.average
Put #1, m, recordvar2
Put #1, m + 1, recordvar
End If
Next m
Next n
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -