RPTools

From MapToolDoc
(Redirected from concat)

add

Contents

add() Function

Adds number and/or strings together. If all of the arguments to the function are numbers then a numeric addition is performed, if any of the arguments are strings then all of the arguments are concatenated as a string.

Usage

  1. [h: result = add(val1, val2, ...)]
  2. [h: result = sum(val1, val2, ...)]
  3. [h: result = concat(val1, val2, ...)]

Examples

Numbers

  1. [r: add(1,4)]
Returns:
  1. 5


Strings

  1. [r: add("Mary", "had", "a", "little", "lamb")]
Returns:
  1. "Maryhadalittlelamb"


Numbers and Strings

  1. [r: add(1,"4")]
Returns:
  1. "14"