by Nathan (7 Submissions)
Category: Math/Dates
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Generates a more random number by using the date and time. Use it in the load event of your form to rarely get the same random number each
Dim Random
Dim x
x = 1
For Random = 1 To Len(Now)
test = Mid(Now, x, 1)
Select Case Random
Case 1
Case 2
Case 3
Case 4
Case 5
Case 6
Case 7
Case 8
Case 9
Case 0
Case Else
Random = 0
End Select
Value = Value + Random
x = x + 1
If x > Len(Now) Then GoTo EndThis
Next Random
EndThis:
If Weekday(Now) = vbSunday Then
Value = Value + Value * Value - 56 * Value ^ 2 / Value + 2
End If
If Weekday(Now) = vbMonday Then
Value = Value
End If
If Weekday(Now) = vbTuesday Then
Value = Value * Value
End If
If Weekday(Now) = vbWednesday Then
Value = Value * Value + Value / 2 + Value * Value * Value - Value + Value / 2 ^ 2
End If
If Weekday(Now) = vbThursday Then
Value = Value ^ 3
End If
If Weekday(Now) = vbFriday Then
Value = Value * Value + Value / 2 + Value * Value * Value - Value + Value / 2 + 587234 * 5 / Value
End If
If Weekday(Now) = vbSaturday Then
Value = Value * Value + Value / 2
End If
Randomize (Val(Value))
No comments have been posted about Generates a more random number by using the date and time. Use it in the load event of your form to. Why not be the first to post a comment about Generates a more random number by using the date and time. Use it in the load event of your form to.