Sitemap Sitemap  |  Contact Us Contact Us  |  Clients Clients
   Random
  Home |  WebHare Lite |  Downloads |  HareScript |  Websites/CMS |  Applications
Search for:  in: 
HareScript
General functions
 
Base functions
Cryptography APIs
Date and time manipulation
Developers support
Mathematic and floating point utility functions
Money type utility functions
Random
  Get a random number
 
Syntax PUBLIC INTEGER FUNCTION Random (INTEGER min,INTEGER max)
 
Description This value returns a random number within the specified range. The size of
the range (max-min) may not be larger than 65000. If the randomizer has not
been seeded yet, it will automatically be seeded using the current clock value.
This is a simple pseudo-random number generator, which is useful for getting simple
random numbers but should not be used for cryptographic or security purposes.
 
Parameters
min Minimum returned value
max Maximum returned value
 
Returns A random value in the specified range
 
Example
//Returns a simulation of a throw with two dices
INTEGER dice1 := Random(1,6);
INTEGER dice2 := Random(1,6);
INTEGER twodice := dice1 + dice2;
 
In library 'system'
Abort
Abs
AnyToString
Avg
BindSchemaToTable
BindTransactionToSchema
BindTransactionToTable
ByteToString
CellDelete
CellExists
CellInsert
CellUpdate
CollectGarbage
Count
DecodeBase16
DecodeBase64
DecodeCharSet
DecodeHTML
DecodeJava
DecodePacket
DecodeURL
DecodeValue
Detokenize
EncodeBase16
EncodeBase64
EncodeCharSet
EncodeHTML
EncodeJava
EncodePacket
EncodeURL
EncodeValue
ExtendObject
GetBestCharacterSet
GetBoundTransactionFromSchema
GetBoundTransactionFromTable
GetByteValue
GetCell
GetUCValue
GroupedValues
IsAtEndOfStream
IsPrintableASCII
IsPrivilegeGranted
IsTypeidArray
IsTypeidComparable
IsValidUTF8
Left
Length
MakeEmptyRecord
MakeObject
Max
MemberExists
Min
ObjectExists
Print
PrintRecordArrayTo
PrintRecordTo
PrintTo
Random
ReadFrom
ReadLineFrom
RecordExists
RedirectOutputTo
Right
SearchElement
SearchLastElement
SearchLastSubstring
SearchSubstring
SeedRandomizer
SendBlobTo
Substitute
Substring
Sum
ToInteger
Tokenize
ToLowercase
ToString
ToUppercase
TrimWhitespace
UCLeft
UCLength
UCRight
UCSearchLastSubstring
UCSearchSubstring
UCSubstring
UCToString
UCTruncate
UnpackRecord
WaitForMultiple
 
Top To top of page