📄 module1.bas
字号:
Attribute VB_Name = "Module1"
'定义全局变量
Const MAXROW_COUNT = 5
Public ROWCOUNT As Integer '练习的字符行数
Public tatalchar As Integer '练习字符总个数
Public playsec As Integer '所用时间
Public mode As Boolean '打字状态
Public mode_label As Boolean
Public scrapname As String
Public deforescrapname As String
Public fontwidth As Integer
Public char_len As Integer '记录每横字符长度
Public rignt_char As Integer '正确字符个数
Public type_time As Long '打字测试的打字时间(默认为1分钟)
Public type_right As Integer '打字测试的正确字符数
Public type_allchar As Integer '打字测试的的总数
Public type_percent As Integer '计算正确率
Public type_show As String '显示打字时间
Public mm As Integer '记录时间的分钟
Public ss As Integer ''记录时间的秒钟
Public ms As Integer ''记录时间的毫钟
'该函数计算打字字符的个数
Public Function all_char() As Integer
Dim current_char As String * 1 '当时要判断的字符
Dim chartotal As Integer '保存字符总数
chartotal = 0
Dim i As Integer
Dim j As Integer
For i = 1 To MAXROW_COUNT Step 1
For j = 1 To Len(tepedtestForm.Label1(i).Caption) Step 1
'空格不记录在字符总数
If (Asc(Mid(tepedtestForm.Label1(i).Caption, j, 1)) <> 32) Then
chartotal = chartotal + 1
' MsgBox "fs"
End If
Next j
Next i
all_char = chartotal
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -