Use VBScript to generate the implementation code for the 36-in-_vbs automatic growth sequence

Source: Internet
Author: User

ASP generates a 0~9,a~z 36 string, running the following example requires the IE core Browser, and other non-IE core browsers do not support VBScript.

Implementation code:

<script language= "VBScript" > Function getinitstring (L) "Initializes a specified length of 0 strings l=l-1 for i=0 to L getinitstring=" 0 "&ge Tinitstring Next End Function function Getnextchar (chrcode) ' Gets the next character if chrcode=57 then ' number and the alphabetic ASCII are incoherent and require special handling GetNext Char= "A" Else GETNEXTCHAR=CHR (chrcode+1) End-If End Function function Getnextno (s,l) ' Gets the string of 1 if trim (s) = "then" initial The string getnextno=getinitstring (L): Exit Function End If L=len (s)-1 Dim A (): ReDim A (L) for i=0 to L ' split into array A (i) =mid (s,i +1,1 next Carry=false ' carry flag for i=l to 0 step-1 ' start at the lowest bit chrcode=asc (A (i)) if carry then if chrcode<>122 Then ' is not Z, after the increment exit for loop, otherwise continue carrying a (i) =getnextchar (Chrcode): Exit For ' exit loop ElseIf i=0 Then ' getnextno= ' has reached its maximum length, cannot continue carrying, need  To modify Length ": Exit Function End If End If if a (i) =" Z "then carry=true:a (i) =" 0 "Else A (i) =getnextchar (Chrcode): Exit For ' exit Loop End If Next for i=0 to L ' combination return string getnextno=getnextno&a (i) Next End Function s= "" Initlen=6 S=getnextn O (S,initlen) MsgBox S ' 000000 S=getnextno (S,initlen) MsgBox S ' 000001 s= "aaazzz" S=getnextno (S,initlen) MsgBox S ' aab000 s= "zzzzzz" S=getnextno (s)

 Initlen) MsgBox S ' has reached its maximum length, cannot continue carrying, need to modify length </script>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.