XenoGuard Documentation

Add

Actions » Programming » Number Operation » Basic » Add 

The action Add calculates the sum of two numbers and stores the sum in Result in the Result List. The following number types are allowed: Floating Point, Signed Number, and Unsigned Number.




[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the Number Operation node.
  3. In the Basic node, select the Add action.

Parameters:

The action has the following input parameters:


name Description
Number Type
Specifies the data type to be used for the numbers to be added and its result.

Allowed Context Scope
 [Fixed]
Allowed Values [Floating Point, Signed Number, Unsigned Number]
Summand 1
The first number to add.

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Summand 2
The second number to add.

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

Results:

The action returns the following results:

name
description
Result Contains the sum of the two numbers.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]

Warning The number type set in the action Add determines the data type of its Result even if the variables and/or parameters that were set as summands are of different data types.

Example 1 (Adding two floating point variables):

This example adds the contents of the two local variables, Sales 1 and Sales 2. Both use the data type, Floating Point. The result of the two numbers then creates an output via Write Text.

Example 2 (Finding the total number of students):

This example adds the contents of the two local variables, Female Students and Male Students. Both use the data type, Number. The Result of adding the values are displayed via Message Box.


See other basic operations:

Add
Subtract
Multiplicate
Divide
Modulo
Power
Root
Increment
Decrement
Random