Record Functions

and Methods

Alpha Five provides the following Record functions and methods.

Function or Method

 

Description

Reading

<FORM>.RECNO_GOTO()

V5

Reads the specified record number.

Reference

TABLE() and DB() functions Contrasted

 

Compares the benefits and limitations of the Table()and DB() functions.

Field Values

ALLTEXT()

V5

Returns a string containing the values of all fields in the record.

ALLTEXT_INITIAL()

V5

Returns a string containing the values of all fields in the record before any changes were made.

CURRENT()

V5

Returns the value of a field or an expression based on field contents for the current record.

CURRENT_RECORD()

V5

Returns the record number of the current record.

CURRENT_RECORD_

NUMBER()

V5

Returns the record number of the current record.

MRECNO()

V5

Returns the record number of the current composite record in a set.

Lookup Functions

EXIST()

V5

Tests for the existence of a record with a specified index key value.

LOOKUP()

V5

Searches an external lookup table for the first record matching a filter, evaluates an expression against that record, and returns the resulting value.

LOOKUPC()

V5

Searches an external lookup table for an indexed record matching the Key_Value, evaluates an expression against that record, and returns the resulting character value.

LOOKUPD()

V5

Searches an external lookup table for an indexed record matching the Key_Value, evaluates an expression against that record, and returns the resulting date value.

LOOKUPL()

V5

Searches an external lookup table for an indexed record matching the Key_Value, evaluates an expression against that record, and returns the resulting logical value.

LOOKUPN()

V5

Searches an external lookup table for an indexed record matching the Key_Value, evaluates an expression against that record, and returns the resulting numeric value.

Management Functions

BLANK_DUPLICATE()

V5

Removes repeating instances of a field value that occur in a sequence of two or more records.

DELETED()

V5

Returns .T. (TRUE) if the current record in Table_Name is deleted; otherwise it returns .F. (FALSE).

IS_RECNO_IN()

V5

Returns .T. (TRUE) if the current record number is in the list of records.

MARKED()

V5

Returns .T. (TRUE) if the current record in Table_Name is marked; otherwise it returns FALSE.

MRECNO()

V5

Returns the record number for a composite record in a set.

RECCOUNT()

V5

Returns the number of records in the specified table.

RECNO()

V5

Returns the record number of the current record in the specified table.

RECORD_ADD()

V5

Adds a new record to Table_Name using the field values specified by Data_List.

RECORD_DELETE()

V5

Deletes one or more records in a table that match filter condition.

RECORD_UPDATE()

V5

Modifies a record in table Table_Name.

RECSIZE()

V5

Returns an Integer that is the size of a record in the specified table.

Sampling Functions

BOTTOM_PERCENT_

RECORDS()

V5

Selects a specified Percent of the bottom records in a table. The table's sort order is determined by the query's Order parameter. Percent is expressed as a whole number, e.g. 50 for 50%.

BOTTOM_RECORDS()

V5

Selects a specified Number of the bottom records in a table. The table's sort order is determined by the query's Order parameter.

EVERY_RECORD_LIST()

V5

Selects every Nth record in a table, for a given sort order and filter.

RANDOM_PCT_

RECORD_LIST()

V5

Returns a space delimited list of record numbers.

RANDOM_PERCENT_

RECORDS

V5

Selects a specified Percent of the random records from a table. If the optional filter is supplied, the records are selected only from those that satisfy the filter. Percent is expressed as a whole number, e.g. 50 for 50%.

RANDOM_RECORD_LIST()

V6

Returns a list of random record numbers from the current table.

RANDOM_RECORDS()

V5

Selects a specified Number of random records from a table. If the optional filter is supplied, the records are selected only from those that satisfy the filter.

SAMPLE_RECORDS()

V5

Selects every Nth record in a table, for a given sort order.

TOP_PERCENT_

RECORDS()

V5

Selects a specified Percent of the top records in a table. The table's sort order is determined by the query's Order parameter. Percent is expressed as a whole number, e.g. 50 for 50%.

TOP_RECORDS()

V5

Selects a specified Number of the top records in a table. The table's sort order is determined by the query's Order parameter.

TOP_RECORDS_LIST()

V5

Selects first Number records from the current table after applying an order expression and an optional filter expression.

TOP_RECORDS_

PCT_LIST()

V5

Selects first Percent records from the current table after applying an order expression and an optional filter expression.

Search Functions

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.

INLIST()

V5

Searches for a matching value in a list of one or more expressions or fields from the same record. The function returns .T. (TRUE) if the Search_Value matches any of the remaining expressions; returns .F. (FALSE) if the value is not found in a specified expression.

SCANNING()

V5

Returns .T. (TRUE) if the current composite record buffer includes data from Table_Name.

Statistical Functions

POP_STDDEV()

V5

A summary function that returns the population standard deviation of the Expression evaluated for a group of records.

POP_VARIANCE()

V5

A summary function that returns the population variance of the Expression evaluated for a group of records.

RUN_STDDEV()

V5

Returns the running standard deviation of the Expression evaluated from the first record to the current record related to the group.

RUN_VARIANCE()

V5

Returns the running variance of the Expression evaluated from the first record to the current record related to the group.

STDDEV()

V5

A summary function that returns the standard deviation of the Expression evaluated for a group of records.

VARIANCE()

V5

A summary function that returns the variance of the Expression evaluated for a group of records.

Summary Functions

AVERAGE()

V5

Returns the Average_Value of the Expression evaluated for a group of records.

DBAVG()

V5

Searches the specified Lookup_Table for one or more records with the specified Key_Value, and returns the average value of the values contained in Lookup_Expression.

DBCOUNT()

V5

Searches the specified Table for one or more records with the specified KeyValue, and returns the number of records found.

DBMAX()

V5

Searches the specified Lookup_Table for one or more records with the specified Key_Value, and returns the largest value of the values contained in Lookup_Expression.

DBMIN()

V5

Searches the specified Lookup_Table for one or more records with the specified Key_Value, and returns the smallest value of the values contained in Lookup_Expression.

DBSUM()

V5

Searches the specified Lookup_Table for one or more records with the specified Key_Value, and returns the sum of the values contained in Lookup_Expression.

COUNT()

V5

Returns the number of records in a group of records.

DUPLICATE()

V5

Returns the number of duplicate records for the Expression evaluated for a group of records.

FIRST()

V5

Returns the first value of the Expression evaluated for a group of records.

LAST()

V5

Returns the last value of the Expression evaluated for a group of records.

MAXIMUM()

V5

Returns the maximum value of the Expression evaluated for a group of records.

MINIMUM()

V5

Returns the minimum value of the Expression evaluated for a group of records.

RUN_AVERAGE()

V5

Returns the Running Average of the Expression evaluated from the first record to the current record related to the group.

RUN_COUNT()

V5

Returns the running count of records of the Expression evaluated from the first record to the current record related to the group.

RUN_MAXIMUM()

V5

A summary function that returns the running maximum of the Expression evaluated from the first record to the current record related to the group.

RUN_MINIMUM()

V5

A summary function that returns the running minimum of the Expression evaluated from the first record to the current record related to the group.

RUN_TOTAL()

V5

Returns the running total of the Expression evaluated from the first record to the current record related to the group.

TABLEAVG()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the average of the values contained in the Lookup_Expression.

TABLECOUNT()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the number of records found.

TABLEMAX()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the largest of the values contained in the Lookup_Expression.

TABLEMIN()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the smallest of the values contained in the Lookup_Expression.

TABLESUM()

V5

Searches the specified Lookup_Table for one or more records that satisfy the specified Filter, and returns the sum of the values contained in the Lookup_Expression.

TOTAL()

V5

Returns the Total_Value (or sum) of the Expression evaluated for a group of records.