ubase.addRecord

Syntax ubase.addRecord (fnum, key, adrTable)

Params fnum is the file refnum identifying the uBASE database that a record will be added to.

key is the key under which to store the record being added.

adrTable is the Frontier database address of a table containing the data for the record (see Notes).

Action A record with the contents given by the table is stored in the database identiÞed by fnum.

If a record already exists with the indicated key, that record is replaced by the new record.

Returns An essentially meaningless number.

Examples If the States Database is open and identiÞed as fnum:
new (tableType, @rec)

rec.capi = "Olympia"

rec.abbr = "WA"

ubase.addRecord (fnum, "Washington", @rec)

This example adds the state named Washington whose capital is Olympia and whose abbreviation is WA to the States Database, replacing the existing record for Washington.

Errors An error is produce if uBASE is not running, if fnum does not identify an open database, if the table does not have entries for every Þeld in the database, or if an entry is not of the correct type

Platform Notes uBASE runs only on Mac OS and is not a supported component of Frontier 5.0,

Notes ubase.addRecord requires a table. There is an entry in this table for each Þeld in the database, with the same 4-character name as the ÞeldÕs name. The value of each entry must be the same type as the ÞeldÕs type; the value becomes the ÞeldÕs value.

Extra entries in the table are ignored.

The key is by deÞnition unique. It can be of any type which can be stored in a database Þeld.

By default, upper case letters in the key are treated as lower case. See ubase.caseSensitive.

See Also ubase.caseSensitive

ubase.deleteRecord

ubase.lookupRecord

Discuss