FB_Array (Function Block)

Static array function block.

Extends: FB_Collection

Implements: I_Array, I_Iterable

Properties

_Begin

Type: T_Position

Index of the first element.

_End

Type: T_Position

Index of the last element.

Methods

Contains

Checks if item is contained in array.

Inputs

Name

Type

Description

Item

ANY

Item to find.

FB_exit

Inputs

Name

Type

Description

bInCopyCode

BOOL

if TRUE, the exit method is called for exiting an instance that is copied afterwards (online change).

FB_init

Inputs

Name

Type

Description

bInitRetains

BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode

BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

Count

T_Capacity

The size of the array.

Get

Gets item from array at specified location.

Inputs

Name

Type

Description

Index

T_Position

Location of item.

Item

ANY

Variable to store returned item.

Outputs

Name

Type

Description

bSuccess

BOOL

Get_As_String

Returns item as a string, if type to string conversion is supported.

Inputs

Name

Type

Description

Index

T_Position

Location of item.

sItem

REFERENCE TO STRING

Variable to store returned item.

Outputs

Name

Type

Description

bSuccess

BOOL

Get_Generic

Gets an item from the array in it’s generic form. Use carefully as this contains the pointer of the actual value in the collection. If you wish to use this it is recommeded you create a copy of the returned value using MEMMOVE or MEMCPY

Inputs

Name

Type

Description

Index

T_Position

Location of item.

Outputs

Name

Type

Description

Item

T_Generic

bSuccess

BOOL

Get_Type_At

Gets the type of the item at specified location.

Inputs

Name

Type

Description

Index

T_Position

Outputs

Name

Type

Description

Item_Type

T_Type

bSuccess

BOOL

Reverse

Reverses the order of items in the array.

Outputs

Name

Type

Description

bSuccess

BOOL

Set

Changes the item at the specified location in the array.

Inputs

Name

Type

Description

Index

T_Position

Location of item.

Item

ANY

Item to store.

Outputs

Name

Type

Description

bSuccess

BOOL

Set_Generic

Changes the item at the specified location in the array in it’s generic form.

Inputs

Name

Type

Description

Index

T_Position

Location of item.

Item

T_Generic

Item to store.

Outputs

Name

Type

Description

bSuccess

BOOL

Swap

Swaps item at index with item at index B.

Inputs

Name

Type

Description

Index_A, Index_B

T_Position

Outputs

Name

Type

Description

bSuccess

BOOL