another vb6 to vb.net question

S

Starbuck

Hi

Simply because the challenge is there I am trying to convert my vb6 code to
vb.net. In the most part I have found ways but here is one I am stuck on, so
any thoughts would be welcome.

Public Function NewJobSerial() As Long
NewJobSerial = CType((Format$(Int(Rnd() * 424) - 212)) + Format$((Timer *
100), "0000000"), Long)
NewJobSerial = NewJobSerial Xor CType(2147483647 * Rnd(), Integer)
End Function

Thanks
 
T

Terry Olsen

How about this?

Public Function NewJobSerial() As Long
NewJobSerial = CType((Format$(Int(Rnd() * 424) - 212)) + _
Format$((Now.Millisecond * 100), "0000000"), Long)
Return NewJobSerial Xor CType(2147483647 * Rnd(), Integer)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top