# recstr, recno, recbool

### recstr(name)

Retrieves the string value previously stored under the value for the name argument.

### recstr(name, source)

Stores the string value of the source argument under the value for the name argument.

### recno(name)

Retrieves the number value previously stored under the value for the name argument.

### recno(name, source)

Stores the number value of the source argument under the value for the name argument.

### recbool(name)

Retrieves the boolean value previously stored under the value for the name argument.

### recbool(name, source)

Stores the boolean value of the source argument under the value for the name argument.

## Arguments

Argument | Data Type | Description
name | string | name by which a value to be stored or retrieved is referred to
source | see above | Type and value of data to be stored under the name argument

## Returns

The previously stored value for the given name argument

## Description

The recstr(), recbool(), and recno() functions are used to create variables that exist only while the current record is being processed. When the next record is fetched from the input, all record variables are destroyed and created new.

To create a variable, provide values for the two arguments. The first value is the name of the variable and the second is the value to be stored. To update a variable, provide the name of the variable to the first argument and the value to update it with.

To retrieve the value of a variable simply provide the name of that variable as the value of the first argument.

All variable names have to be string values.

The types of values (string, number, boolean) that can be stored are determined by the specific function used. recstr() holds string values, recbool() holds boolean values, recno() holds number values. This means that the function recbool() can only hold boolean objects, such as the value of a function that returns a boolean value: it will not accept strings, such as "true" or "false"

Each variable will only hold one value.

Unlimited variables can be created for all variable types.

Remember, the values in all variables only last as long as the record is current.

## Examples

Assume that these examples are performed in the same order that they are listed

Assume that field1 contains the value "The quick brown fox"

Example | Returns | Description
recstr("test", "test me") | test me | Places the string value "test me" into the variable under the name "test" and returns the value
recstr("test") | test me | returns the previously stored string value for the variable named "test"
recstr("test", "test me again") | test me again | replaces the previously stored string value for "test" with the new string value and returns that value
recno("testnum", 100) | 100 | Places the number value 100 into the variable under the name "testnum" and returns the value
recbool("testbool", contains(#1,"a")) | false | Places the boolean value "false" into the testbool variable and returns that value

## See Also

counter(), recno(), sesstr(), sesnum(), sesbool(), glostr(), glonum(), globool(), exists(), flushglovar()