Keep Last X Elements In Array

The "Keep Last X Elements In Array" block in GraphLinq IDE is crucial for maintaining only the most recent elements in an array.

Block Description

Part of the Array category, this block is designed to trim an array to a specified size, keeping only the most recent elements.

Input Parameters

  • Array (List): The array to be trimmed.

    Output This block does not have a direct output but modifies the input array to keep only the last specified number of elements.

    Example Use Case In a real-time weather monitoring graph, the "Keep Last X Elements In Array" block can be used to maintain only the most recent temperature readings, discarding older data.

  • Amount To Keep (int): The number of elements to retain in the array.

Output

This block does not have a direct output but modifies the input array to keep only the last specified number of elements.

Example Use Case

In a real-time weather monitoring graph, the "Keep Last X Elements In Array" block can be used to maintain only the most recent temperature readings, discarding older data.

Last updated