VB6Parse / Library / Runtime State / randomize

VB6 Library Reference

Parse a VB6 Randomize statement.

Syntax

Randomize [number]

Arguments

Part Optional / Required Description
number Optional A Variant or any valid numeric expression that is used as the new seed value to initialize the random number generator.

Remarks

Examples

' Initialize random number generator
Randomize
x = Int((100 * Rnd) + 1)

' Initialize with specific seed
Randomize 42
x = Rnd

' Use timer as seed
Randomize Timer

References

Microsoft VBA Language Reference - Randomize Statement

← Back to Runtime State | View all statements