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]
Ara 18 2014
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ı
By Burhan KARADERE • Bilişim - IT Haber, VB (Ms Visual Script) • 0 • Tags: basic, example, rastgele, sayı, script, üretmek, vb, visual