VB Visual Basic Script ile rastgele ramdom randomize sayı üretmek.

Paylaş.

Function GenRndNum(DigLen)
Randomize

TheZeros = “1”
For x = 1 to Cint(DigLen)
TheZeros = TheZeros & “0”
Next

GenRndNum = Int((Rnd * 1) * Cdbl(TheZeros))

If Len(GenRndNum) < Cint(DigLen) Then
Do Until Len(GenRndNum) = Cint(DigLen)
GenRndNum = CStr(GenRndNum) & CStr(Int(Rnd * 10))
Loop
End If

Wscript.echo GenRndNum

End Function

GenRndNum(1) ‘ bir rakamlı
GenRndNum(5) ‘ 5 rakamlı

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)