求VB高手翻译一下代码意思
FunctionOnButtonIfCpDlg.Sec(CpSec,CpData.MinCode,CpData.CodeCount)ThenCpSec.SaveTmpFi...
Function OnButton
If CpDlg.Sec(CpSec, CpData.MinCode, CpData.CodeCount) Then
CpSec.Save TmpFile
OnButton = True
Else
OnButton = False
End If
End Function
Function cmdSJ
N = CpData.CodeCount\CpSec.Count
M = CpData.CodeCount Mod CpSec.Count
MaxSecLB = ""
C = 0
While C < M
x = CInt(CpSec.Count * Rnd)
If x = 0 Then x = 1
If x < 10 Then x = "0" & x
If InStr(MaxSecLB, x) < 1 Then
MaxSecLB = MaxSecLB & x & " "
C = C + 1
End If
Wend
CCC = CpSec.Count - 1
CpSec.Clear
For i = 0 To CCC
SecNum = i + 1
If SecNum < 10 Then SecNum = "0" & SecNum
If M > 0 And InStr(MaxSecLB, SecNum) Then
K = N + 1
Else
K = N
End If
C = 0
SecLB = ""
While C < K
x = CpData.MinCode + CInt(CpData.MaxCode * Rnd)
If x > CpData.MaxCode Then x = CpData.MaxCode
If x < 10 Then x = "0" & x
If InStr(LB, x) < 1 Then
SecLB = SecLB & x & " "
LB = LB & SecLB
C = C + 1
End If
Wend
CpSec.Add "段" & i+1 & "=" & SecLB
Next
CpSec.Save TmpFile
cmdSJ = True
End Function
Function Main 展开
If CpDlg.Sec(CpSec, CpData.MinCode, CpData.CodeCount) Then
CpSec.Save TmpFile
OnButton = True
Else
OnButton = False
End If
End Function
Function cmdSJ
N = CpData.CodeCount\CpSec.Count
M = CpData.CodeCount Mod CpSec.Count
MaxSecLB = ""
C = 0
While C < M
x = CInt(CpSec.Count * Rnd)
If x = 0 Then x = 1
If x < 10 Then x = "0" & x
If InStr(MaxSecLB, x) < 1 Then
MaxSecLB = MaxSecLB & x & " "
C = C + 1
End If
Wend
CCC = CpSec.Count - 1
CpSec.Clear
For i = 0 To CCC
SecNum = i + 1
If SecNum < 10 Then SecNum = "0" & SecNum
If M > 0 And InStr(MaxSecLB, SecNum) Then
K = N + 1
Else
K = N
End If
C = 0
SecLB = ""
While C < K
x = CpData.MinCode + CInt(CpData.MaxCode * Rnd)
If x > CpData.MaxCode Then x = CpData.MaxCode
If x < 10 Then x = "0" & x
If InStr(LB, x) < 1 Then
SecLB = SecLB & x & " "
LB = LB & SecLB
C = C + 1
End If
Wend
CpSec.Add "段" & i+1 & "=" & SecLB
Next
CpSec.Save TmpFile
cmdSJ = True
End Function
Function Main 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询