File MIES_Utilities_List.ipf

utility functions for lists

Functions

string ListMatchesExpr(string list, string matchExpr, variable exprType)

Matches list against the expression matchExpr using the given convention in exprType

string ListFromList(string list, variable itemBegin, variable itemEnd, string listSep = defaultValue)

return a subset of the input list

Parameters:
  • list – input list

  • itemBegin – first item

  • itemEnd – last item

  • listSep – [optional] list Separation character. default is “;”

Returns:

a list with elements ranging from itemBegin to itemEnd of the input list

string BuildList(string format, variable start, variable step, variable stop)

Create a list of strings using the given format in the given range.

Parameters:
  • format – formatting string, must have exactly one specifier which accepts a number

  • start – first point of the range

  • step – step size for iterating over the range

  • stop – last point of the range

variable WaveListHasSameWaveNames(string listOfWaves, string *baseName)

Checks wether the wave names of all waves in the list are equal Returns 1 if true, 0 if false and NaN for empty lists.

Parameters:
  • listOfWaves – list of waves with full path

  • baseName[out] Returns the common baseName if the list has one, otherwise this will be an empty string.

string AddPrefixToEachListItem(string prefix, string list, string sep = defaultValue)

Add a string prefix to each list item and return the new list.

string AddSuffixToEachListItem(string suffix, string list, string sep = defaultValue)

Add a string suffix to each list item and return the new list.

string RemovePrefixFromListItem(string prefix, string list, string listSep = defaultValue, variable regExp = defaultValue)

Remove a string prefix from each list item and return the new list.

UTF_NOINSTRUMENTATION

string MergeLists(string l1, string l2, string sep = defaultValue)

Merges list l1 into l2. Double entries in l2 are kept. “a;b;c;” with “a;d;d;f;” -> “a;d;d;f;b;c;”.

string PrepareListForDisplay(string list)

Replace the list separator (semicolon) by a CR.

variable NumberFromList(variable index, string list, string sep = defaultValue)

Return the nth list element as number.