Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random from VFP to VB.NET
Message
From
05/11/2003 18:32:30
 
 
To
05/11/2003 18:24:12
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00846848
Message ID:
00846863
Views:
30
>>I would like to convert this from VFP to VB.NET:
>>
>>
>>ALLTRIM(TRANSFORM(INT(RAND()*10000000000000000000),'99999999999999999999'))
>>
>
>I did this.
>
>
>   ' Return a random file name
>   ' expC1 Start of the file name
>   Private Function GenerateFileName(ByVal tcStart As String) As String
>      Dim lnInteger As Integer
>      Dim loRandom As New Random
>      lnInteger = loRandom.NextDouble() * 1000000000
>      Return tcStart + lnInteger.ToString().PadLeft(30, "0")
>   End Function
>
>
>This is as close as I can get as I cannot get a random number for such a big number in VB.NET. If someone could enhance that code, it'd be appreciated.

If you need a 30 digit number, can't you just do what you've done 3 times as 10 digit numbers and concatenate the strings?
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform