System.Flatten - Manhunter07/MFL GitHub Wiki

Declaration

function Flatten(Value: System.Struct): System.Struct = \built-in\

Description

The Flatten function in the System package flattens an array or a record by removing its depth and spreading all sub-values recursively uppon its root sequence. It retruns the orderly-flattened version of a value passed uppon the Value parameter. The parameter accepts any value supported by the Struct type. This includes Strings, Arrays or Records (note however, that because Strings cannot have a depth themselves, they are returned without modifications.

The result data type depends on that of the Value parameter:

  • For a string input, the function returns a new string
  • For an array input, the function returns a new array
  • For a record input, the function returns a record

See also