O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

seed — Set the seed value for the random number generator

Usage

Lang.seed(seed)

seed : Number

Description

Seeds the random number generator used by Lang.random( ). If seed is less than zero, uses a random internal value (typically, the system time). Otherwise, uses seed to seed the generator. If seed is a floating-point value, Float.int( ) first converts it to an integer.

Returns the empty string; but if seed can’t be converted to a number, returns invalid.

Examples

Lang.seed(23)

seeds with integer 23 and returns ""

Lang.seed(1.2)

seeds with integer 1 and returns ""

Lang.seed("foo")

returns invalid and doesn’t change the seed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required