代码如下:
Private Sub Command1_Click()
a1 = Text3.Text: a2 = Text4.Text
If a1 = "" Or a2 = "" Then
MsgBox "请输入条码流水号段!"
Exit Sub
End If
ReDim a(a1 To a2) As Integer
For i = a1 To a2
a(i) = i
Text1.Text = Text1.Text & a(i) & vbCrLf
K = Bits(a(i))
b = "00" & K
b = Right(b, 3)
c = Text5.Text
Text2.Text = Text2.Text & c & b & vbCrLf
Next i
Text6.Text = Text4.Text
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Text2.Text = ""
Command1.Enabled = True
End Sub
Private Sub Command3_Click()
CommonDialog1.Filter = "文本文档|*.txt"
CommonDialog1.ShowSave
If Len(CommonDialog1.FileName) > 0 Then
Open CommonDialog1.FileName For Output As #1
Print #1, Text2.Text
Close
MsgBox "保存完毕!"
End If
End Sub
Private Sub Command1_Click()
a1 = Text3.Text: a2 = Text4.Text
If a1 = "" Or a2 = "" Then
MsgBox "请输入条码流水号段!"
Exit Sub
End If
ReDim a(a1 To a2) As Integer
For i = a1 To a2
a(i) = i
Text1.Text = Text1.Text & a(i) & vbCrLf
K = Bits(a(i))
b = "00" & K
b = Right(b, 3)
c = Text5.Text
Text2.Text = Text2.Text & c & b & vbCrLf
Next i
Text6.Text = Text4.Text
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
Text2.Text = ""
Command1.Enabled = True
End Sub
Private Sub Command3_Click()
CommonDialog1.Filter = "文本文档|*.txt"
CommonDialog1.ShowSave
If Len(CommonDialog1.FileName) > 0 Then
Open CommonDialog1.FileName For Output As #1
Print #1, Text2.Text
Close
MsgBox "保存完毕!"
End If
End Sub