Random [minimum], [maximum] v1.1
Returns a randomized numerical value. If no minimum and maximum values are given, then a float number between zero and one (inclusive) is returned.
If a minimum and maximum are provided then the number returned will always lie between the two (inclusive). If both the minimum and maximum numbers are integers, then the return value is also an integer. If either the minimum or maximum number is a float, then a float value is returned.
Some examples:
$num = Random 1, 3 # will be 1, 2, or 3.
$num = Random -1, 2 # will be -1, 0, 1, or 2.
$num = Random # might be 0, 1, 0.2, 0.14159265, 0.999, etc.
$num = Random 1, 2.5 # might be 1, 2.5, 1.123, 2.0, etc.
Convert To Hex integer v1.2
Converts the given number to a capitalized hexadecimal string with no prefix, eg:
$hex = Convert To Hex 42 # returns “2A”
Convert From Hex hexString v1.2
Converts the given hexadecimal string to its integer value. Whitespace preceding the characters in the string are ignored and both uppercase and lowercase letters are allowed. The string may be prefixed with “0x” or “U+” or have no prefix at all. The following lines all set the value of the variable to 42:
$value = Convert From Hex '2A'
$value = Convert From Hex ' 2A'
$value = Convert From Hex '0x2A'
$value = Convert From Hex 'U+002A'
Previous Chapter Miscellaneous Commands |
<< index >> |
Next Chapter AppleScript |