Arrays

Name -- Syntax / Description
miva_array_collapse
miva_array_collapse( aggregate var )
Collapses the array_variable making the indices sequential starting at 1. Returns the number of elements in the array.
miva_array_deserialize
miva_array_deserialize( string )
Reverses miva_array_serialize(). Returns an aggregate array repopulated to match the original.
miva_array_elements
miva_array_elements( aggregate var )
Returns the number of elements in the array_variable that were actually used.
miva_array_max
miva_array_max( aggregate var )
Return the maximum array_variable index used.
miva_array_min
miva_array_min( aggregate var )
Return the minumum array_variable index used.
miva_array_next
miva_array_next( aggregate var, index )
miva_array_previous
miva_array_previous( aggregate var, index )
miva_array_serialize
miva_array_serialize( aggregate var )
Returns a string representation of the array and any subarrays. Can be used to store an entire array in a database for later retreival.
miva_array_sort
miva_array_sort( aggregate var, callback, data var )
This function will sort an array structure
Returns the number of array elements in the aggregate array structure after sorting.
  • Aggregate: The array that will be sorted. (the aggregate will be physically altered on return)
  • Callback: The name of a user function that must exist in your program, defined as Callback(left var, right var, data var)
  • Data: Not directly used in the miva_array_sort(), the value will be passed to the Callback function.
miva_element_exists
miva_element_exists( array var, index )
Tests if an element exists where: array is an array and index is index number being tested.
Returns 1 if the element found else 0
miva_member_exists
miva_member_exists( structure var, member )
Tests if a member exists where: 'structure' is a data structure and 'member' is the name of a structure member being tested. Returns 0 or 1.
Returns 1 if found else returns 0
  • structure: A data structure or structured array that is tested. It is passed by reference to the function.
  • member: The literal member name or a variable that evaluates as the member name.
User Annotations: arrays