Tag Link | [Math_Random] | Category | Math |
---|---|---|---|
Type | Substitution | Source Available | No |
Support | Preferred | Version | 5.0 |
Change | Unchanged | Data Source | Any |
Output Type | Decimal, Integer, or String | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0 |
Lasso 3 Equivalent | [RandomNumber] |
[Math_Random] returns a random number. This tag can be used to return a random number between the required
If both
If either
Note: When returning integer values [Math_Random] can return at most 32
[Math_Random:
[Math_Random:
Optional Parameters | |
---|---|
-Lower | The minimum random number to return. |
-Upper | The maximum random number to return. |
-Hex | If specified the random number will be returned in hexadecimal format. |
Note: Versions of [Math_Random] prior to Lasso 8.0.1 accepted
When using
To generate a random HTML color:
Use the [Math_Random] tag to generate three random hexadecimal numbers between 16 and 255. The following code creates a table cell with a random color.
[Variable: 'Color'=(Math_Random:
(Math_Random:
(Math_Random:
<table border="1" cellpadding="9" cellspacing="0">
<tr>
<td bgcolor="#[Variable: 'Color']">
[Variable: 'Color']
</td>
</tr>
</table>
<table>
<tr>
<td color="#05D4A1">
[Variable: 'Color']
</td>
</tr>
</table>