add | |||||||||||||||||||
Type | command | ||||||||||||||||||
Dictionary | LCS | ||||||||||||||||||
Library | LiveCode Script | ||||||||||||||||||
Syntax |
| ||||||||||||||||||
Summary | Adds a number to a container and places the resulting value in the container. | ||||||||||||||||||
Introduced | 1.0 | ||||||||||||||||||
OS | mac, windows, linux, ios, android | ||||||||||||||||||
Platforms | desktop, server | ||||||||||||||||||
Parameters |
| ||||||||||||||||||
Example |
| ||||||||||||||||||
Related | Keyword: element Property: numberFormat Command: combine, multiply, split, union Function: sum, value Glossary: array, command, container, element, evaluate, expression, format, property, math operation Object: button, field | ||||||||||||||||||
Description | Use the add command to add a number to a container or a portion of a container, or to add two arrays containing numbers. The contents of the container (or the chunk of the container) must be a number or an expression that evaluates to a number. If a number is added to an arrayContainer, the number is added to each element. If an array is added to an arrayContainer, both arrays must have the same number of elements and the same dimension, and each element in the array is added to the corresponding element of the arrayContainer. If the container or an element of the arrayContainer is empty, the add command treats its contents as zero. If container is a field or button, the format of the sum is determined by the numberFormat property. If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information. | ||||||||||||||||||
Tags | math |