List Processing Functions

Alpha Five provides the following List Processing functions.

Processing

Function

 

Description

*FOR_EACH()

V5

*FOR_EACH()is a very quick and efficient way of performing a command on every entry in a CR-LF delimited list of values, or in an array.

Built-In Lists

Function

 

Description

COUNTRIESOFWORLD()

V6

Returns a CR-LF delimited list of countries in the world.

COUNTRYLOOKUP()

V6

Returns either the name or number of a country (as defined by the COUNTRIESOFWORLD() function), given the number or name.

CSTATE_ABREVLOOKUP()

V6

Returns the two character abbreviation for a US state or Canadian province.

CSTATES()

 

V5

Creates a character string containing the names or abbreviations for the states of the United States, United States territories, the District of Columbia, and all of the Canadian Provinces.

REGION_FROM_AREACODE()

V6

Returns the region for the specified telephone area code

SELECTLIST()

V5

Returns the value indicated by the Index parameter.

Inserting and Deleting

Alpha Five provides the following List Processing functions.

Function

 

Description

*LINE_INSERT()

V6

Inserts line(s) into a string starting at the line position defined by Start_Line.

*WORD_INSERT()

V6

Inserts a word at a specified position in a delimited list.

*WORD_REMOVE()

V6

Removes one or more words at a specified position in a delimited list.

*WORD_REPLACE()

V6

Replaces a word at a specified position in a delimited list.

Sorting and Removing Duplicates

Alpha Five provides the following List Processing functions.

Function

 

Description

*REMOVE_DUPLICATES()

V5

Removes duplicate entries from a list sorted in ascending order. Case sensitive. See also WORD_UNIQUE().

*REMOVE_DUPLICATESI()

V5

Removes duplicate entries from a list sorted in ascending order. Case insensitive. See also WORD_UNIQUE().

*REVERSE_WORDS()

V6

Reverses a delimited list of entries.

Line_ReverseOrder()

V6

Reverses the order of a CR-LF delimited list.

SORTSTRING_BY_LENGTH()

V5

Sorts a delimited string using the length of its values.

SORTSUBSTR()

V5

Sorts a delimited string of values. Used to alphabetize a list.

WORD_UNIQUE()

V5

Returns a list of unique words in a delimited string. Used to eliminate duplicates from a list.

Summarizing

Alpha Five provides the following List Processing functions.

Function

 

Description

*AVERAGE()

V6

Returns the average of a CR-LF delimited list of numbers.

*COUNT()

V6

Returns the number of elements in a CR-LF delimited list.

*MAX()

V6

Returns the largest number of elements in a CR-LF delimited list of numbers.

*MIN()

V6

Returns the smallest number of elements in a CR-LF delimited list of numbers.

*TOTAL()

V6

Returns the total of elements in a CR-LF delimited list of numbers.

Importing and Exporting

Alpha Five provides the following Import and Export List Processing functions.

Function

 

Description

<ARRAY>.DUMP()

V5

Creates a CR-LF delimited string of a single dimensional array's contents.

<ARRAY>.INITIALIZE()

V5

Populates an array with values contained in a character list.

<COLLECTION>.DUMP()

V5

Returns all of the data (key and data) in the specified collection in a CR-LF delimited string.

<COLLECTION>.INITIALIZE()

V5

Populates a collection with the data in a CR-LF delimited list.

<TBL>.IMPORT_ASCII_TABLE()

V5

Imports a CR-LF delimited ASCII file directly into a table.

<TBL>.POPULATE_FROM_STRING()

V5

Imports the contents of a list into a table.

<TBL>.RECORD_CONTENT_GET()

V8

Returns a CR-LF delimited list of field values from an open table.

WORD_REPLACE()

V5

Replaces a word or entry in a CR-LF delimited list.

Counting

Alpha Five provides the following List Processing functions for counting.

Function

 

Description

LINE_COUNT()

V5

Returns the number of lines in a CR-LF delimited character string list.

OCCURS()

V5

Returns the number of times the Find_String is found in the Search_In_String.

OCCURS_WORDS()

V5

Returns the number of times Word appears in Search_In_String.

OCCURSI()

V5

returns the number of times the Find_String is found in the Search_In_String. Case insensitive.

WORD_OCCURS()

V5

Returns the number of times Word appears in Search_In_List.

WORD_NUMBER_GET()

V5

Returns the integer list position of the Find_String in the Search_In_String.

Formatting

Alpha Five provides the following List Processing functions for formatting.

Function

 

Description

*TREE_FROM_OUTLINE()

V6

Converts an indented list into data formatted for display in a tree control.

*TREE_TO_OUTLINE()

V6

Converts data formatted for a tree control into an indented list.

CSTATE()

V5

Converts a two-character string containing a State_Code to its full State_Name.

REMOVE_BLANK_LINES()

V5

Removes all lines in a CR-LF delimited list that have NULL ("") content.

TAGGED_PATTERN()

V5

Parses the Input_String (into "tags", or "fields") using the format specified by the Input_Format string and creates a formatted character string based on the format specified by Output_Format.

WORD_CHANGE()

V5

Transforms each word in Input_List into a new word based on a format string.

WORD_EVALUATE()

V5

Evaluates an expression on each word in Input_String.

WORD_SUBTRACT()

V5

Removes all of the "words" or entries in a secondary list from the list of "words" or entries in a primary list. Case-insensitive.

WORD_SUBTRACTC()

V5

Removes all of the "words" or entries in a secondary list from the list of "words" or entries in a primary list. Case-sensitive.

WORD_TAGGED_PATTERN()

V5

Parses each "word" (or "record") in the input string (into "tags", or "fields") using the format specified by the Input_String string and creates an output result string based on the format specified by Output_Format.

Finding, Searching, and Replacing

Alpha Five provides the following List Processing functions for search and replace.

Function

 

Description

*LINE_REMOVE()

V6

Removes line(s) of text in a CR-LF delimited string.

*LINE_REPLACE()

V6

Replaces line(s) of text in a CR-LF delimited string.

*PATTERN_LOOKUP()

V7

Search a list for a pattern and returns a specified value. Case sensitive.

*PATTERN_LOOKUPI()

V7

Search a list for a pattern and returns a specified value. Case insensitive.

*PATTERN_EXTRACT()

V7

Searches for patterns and performs replacement operations.

*WORD()

V5

Returns .T. (TRUE) if Find_String is a whole word in Search_In_String.

*WORDI()

V5

Returns .T. (TRUE) if Find_String is a whole word in Search_In_String.

*WORD_REMOVE()

V5

Removes one or more words from a string.

*WORD_REPLACE()

V5

Replaces one or more words in string.

COMMA_TO_CRLF()

V6

Converts a comma delimited list to a CR-LF delimited list.

CRLF_TO_COMMA()

V6

Converts a CR-LF delimited list to a comma delimited list.

EXTRACT_ALL_STRINGS()

V5

Returns all occurrences of text beginning and ending with specified character sequences.

EXTRACT_STRING()

V5

Extracts a sub-string from a string. The sub-string is defined by a starting and ending block of text.

FILTER_STRING()

V5

Takes an Input_List that is divided into logical "records" by a Delimiter and either extracts or excludes the "records" that contain the Find_String characters anywhere within each "record" in the string. Case-insensitive. Used to extract a list from a larger text file.

FILTER_STRINGC()

V5

Takes an Input_List that is divided into logical "records" by a Delimiter and either extracts or excludes the "records" that contain the Find_String characters anywhere within each "record" in the string. Case-sensitive. Used to extract a list from a larger text file.

FILTER_STRING_MULTI()

V6

Takes an Input_List that is divided into logical "records" by a Delimiter and either extracts or excludes the "records" that contain one or more filter elements anywhere within each "record" in the string. Used to extract a list from a larger text file.

FILTER_STRING_SMATCH()

V5

Takes an Input_List that is divided into logical "records" by a Delimiter and either extracts or excludes the "records" that contain the Find_String characters anywhere within each "record" in the string. Used to extract a list from a larger text file.

INLIST()

V5

Determines whether a word is found in a list of words.

INLIST2()

V6

Determines whether a word is found in a list of words.

IS_ONE_OF()

V5

Determines whether a text string is a member of a list.

POS_FROM_WORD_NUMBER()

V5

Returns the position of the first character of the entry specified by Entry_Number in the Search_List.

WORD_EXISTS()

V5

Determines whether a word exists in a list.

WORD_MOVE()

V5

Moves a word or entry from one position to another in a CR-LF delimited list.

WORD_NUM()

V5

Returns the position of a word or entry in a CR-LF delimited list.

WORD_REMOVE()

V5

Removes the word indicated by position from a CR-LF delimited list.

WORD_REPLACE()

V5

Replaces a word or entry in a CR-LF delimited list.

<StringScanner>.Replace()

V7

Searches for and replaces character strings.

See Also

Character Functions, FILEFIND Methods, StringScanner, Addressing and Tracking Functions