XenoGuard 4.0 Documentation

Shift Left

ActionStep Reference » Programming » Number Operation » Logic » Shift Left 

The ActionStep Shift Left moves the bits to the left based on a specified number and stores the number in Result of the result list. The trailing bit or bits after moving to the left are filled with zero ("0"). The following number types are allowed: Signed and Unsigned.


[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. Open the Number Operation node.
  3. In the Logic node, select the Shift Left ActionStep.

Parameters:

The ActionStep has the following input parameters:


NAME DESCRIPTION
Number Type
Specifies the data type to be used for a number.

Allowed Context Scopes
 [Fixed, Local, Global]
Allowed Values [Signed Number, Unsigned Number]
Pattern 1
The number whose bits are to be moved towards the left.

Allowed Context Scopes
 [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Pattern 2
The number of places the bits have to move towards the left.

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

Results:

The ActionStep returns the following results:


NAME
DESCRIPTION
Result Contains the shifted number.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Number System [Binary, Decimal, Hexadecimal]

Warning

The number type set in the ActionStep Shift Left determines the data type of its Result even if the variables and/or parameters that were set for patterns 1 and 2 are of different data types.
An overflow error can occur if the Result is out of range for its specified data type. For instance, setting pattern 2 with a negative signed value will result in this error type. 

Example 1 (Display a variable's hex value after shifting to the left):

This example moves the bits to the left for the local Hash variable with an Unsigned Number data type. The result is changed from Decimal to Hexadecimal value with the conversion operation and is then output via Write Text.

See other Logic operations:

Bit AND
Bit NOT
Bit OR
Bit XOR
Shift Right