Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbscript to generate 36-ary auto-increment serial numbers

Shulou Source: shulou.com Published: 2022-06-03 08:43:37 11月15日 Update

This article mainly introduces how to use vbscript to generate 36-ary automatic growth serial numbers, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

Asp generates a 36-ary string of 0x9. Running the following example requires a browser that uses the IE core. Other non-IE core browsers do not support vbscript.

Implementation code:

Function getinitstring (l) 'initializes the 0 string of specified length l=l-1 for iS0 to l getinitstring= "0" & getinitstring nextend functionfunction getnextchar (chrcode)' to get the next character if chrcode=57 then' numeric and alphanumeric ascii incoherent Special processing is required for getnextchar= "a" else getnextchar=chr (chrcode+1) end ifend functionfunction getnextno (sjocal)'to get the string if trim (s) that increments 1 from "" then' initialization string getnextno=getinitstring (l): exit function end if l=len (s)-1 dim a (): redim a (l) for ionomer 0 to l' is split into an array a (I) = mid (s) 1) next carry=false' carry flag for ionoml to 0 step-1 'traverses chrcode=asc (a (I)) if carry then if chrcode122 then' from the lowest bit, not z Exit the for loop after increment, otherwise continue to carry a (I) = getnextchar (chrcode): exit for' exit loop elseif item0 then getnextno= "has reached the maximum length and cannot continue to carry. Need to modify the 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 item0 to l' combination returns the string getnextno=getnextno&a (I) nextend functions="initlen=6s=getnextno (sforce initlen) msgbox s'000000s=getnextno (sdjinitlen) msgbox msgbox 000001s =" aaazzz "s=getnextno (smae initlen) msgbox sendaab000s =" zzzzzz "s=getnextno (s) Initlen) msgbox s' has reached its maximum length Can not continue to carry, need to modify the length of thank you to read this article carefully, I hope the editor to share the "how to use vbscript to generate 36-ary automatic growth serial number" this article is helpful to you, but also hope that you support more, pay attention to the industry information channel, more related knowledge waiting for you to learn!

Tags: Character string length article base generation loop serial number growth maximum core browser support browsing minimum special code value interest at the same time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Linux NVidia MySQL macOS