FANDOM


Subtracts a number from a container (object or variable) and places the resulting value in the container.

Syntax:

subtract {<number> | <array>} from <arrayContainer>

Examples:

subtract 5 from tSize
put "10,10" into tPoint
subtract 5 from item 2 of tPoint -- subtracts 5 from the second item
put 10 into tArray["height"]
put 10 into tArray["width"]
subtract 5 from tArray -- subtracts 5 from both width and height

Use the subtract command to subtract a number from a container or a portion of a container, or to subtract 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 subtracted from an arrayContainer, the number is subtracted from each element of the array. If an array is subtracted from an arrayContainer, both arrays must have the same number of elements and the same dimension, and each element in the array is subtracted from the corresponding element of the arrayContainer.

If the container or an element of the arrayContainer is empty, the subtract command treats its contents as zero.

If container is a field or button, the format of the sum is determined by the numberFormat property.

Parameters:

  • number: Any expression that evaluates to a number.
  • chunk: A chunk expression specifying a portion of the container.
  • container: A field, button, or variable, or the message box.
  • array (array):
  • arrayContainer (array): An array variable each of whose elements is a number.
  • Description: Use the subtract command to subtract a number from a container or a portion of a container, or to subtract two arrays containing numbers.

See also: Special chars like +,-,&,... (operators), numberFormat (property),

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.