Number Operation Add
ActionStep Reference » Programming » Number Operation » Basic » Number Operation Add
The ActionStep 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.
- Open the Programming node in the Workspace Explorer.
- Open the Number Operation node.
- In the Basic node, select the Add ActionStep.
Parameters:
The ActionStep 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 ActionStep 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] |
The number type set in the ActionStep 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