RAD function: denull

A RAD function that compresses an array by removing all trailing NULL entries and returns the compressed array.

Function

denull

Format

denull(array)

Factors

  • If the array contains a NULL entry in the middle of the array, that entry is not removed.
  • Using denull on an empty array of structures converts the array of structures to a simple array.

    Note Always test for NULL first.

  • Displaying arrays extends the length of the array to accommodate window size.

    Tip It is a good practice to denull arrays before records are added or updated. You can use denull(contents()) to accomplish this, but you should first ensure that the contents do not include any empty array of structures or they will be converted to simple arrays.

Example

denull({1,2,3,,})

Returns {1,2,3}.

denull({1,,2,,})

Returns {1,,2}.