Germini Posted October 18, 2015 Report Share Posted October 18, 2015 (edited) Public Const cHideWindow = 0, cNormalWindow = 1 Set WSHShell = Wscript.CreateObject("WScript.Shell") Set FSO = Wscript.CreateObject("Scripting.FileSystemObject") Set EnvVar = wshShell.Environment("Process") tBestand= ".\RUTs.txt" Set Bestand = fso.createtextfile(tBestand,1) Dim iRUT, iTotal, iResto, iResta, s For x=5000000 To 19000000 Step 1 s = Trim(x) i=Len(s) ii = 2 iTotal = 0 Do Until i=0 iTotal = iTotal + Mid(s, i, 1) * ii iResto = iTotal Mod 11 iResta = 11 - iResto If iResta>=1 & iResta <=9 Then iVerificador = iResta If iResta= 11 Then iVerificador = "0" If iResta= 10 Then iVerificador = "k" i = i - 1 ii = ii + 1 If ii=8 Then ii=2 Loop Bestand.WriteLine(Right(x & "-" & iVerificador,10)) Next Bestand.close WScript.quit Rut_generator.vbsDesde x=5000000 To 19000000Saludos Edited October 18, 2015 by Germini Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now