现在要写一个编号,要从001开始,到100结束,怎么做?

dada_27340 2021-3-25 574

现在要写一个编号,要从001开始,到100结束,怎么做?

有老师解答下吗


最新回复 (5)
  • 杨XX_78437 2021-3-25
    2
    用计次循环
    for i = 0 to 100
        if i<10
            编号 = "00"&i
        elseif i>9 and i<100
            编号 = "0"&i
        else
            编号 = ""&i
        end if
    next
  • 杨XX_78437 2021-3-25
    3
    还有一种方法
    for i = 0 to 100
    Dim 编号 = ""
        for j = 1 to 3-len(CStr(i))
            编号 = 编号&0
        next
            编号 = 编号&i
    next
  • determine 2021-3-26
    4
    我也来写一个
    For i = 1001 To 1100 Step 1
           TracePrint SubStr(CSTR(i),2,3)
    Next
  • 与UiBot共舞 2021-3-26
    5
    determine 我也来写一个 For i = 1001 To 1100 Step 1 TracePrint SubStr(CSTR(i),2,3) Next
    优秀
  • 与UiBot共舞 2021-3-26
    6
    Dim sRet = ""
    For i = 1 To 100 Step 1 
           sRet = Right("00"&i,3)        
           TracePrint(sRet)
    Next
返回
发新帖