我需要0 - 9999
在 VB 中计算。如何制作格式0000 - 9999
,以便输出为:
0000, 0001, 0002, 0003, .......
我使用了以下代码
Dim p4num As Integer = 0
Dim p3num As Integer = 0
Dim p2num As Integer = 0
Dim p1num As Integer = 0
p4num += 1
If p4num = 10 Then
p4num = 0
p3num += 1
If p3num = 10 Then
p3num = 0
p2num += 1
If p2num = 10 Then
p2num = 0
p1num += 1
End If
End If
End If
但我会用另一种方式来做。任何的想法?