Skip to main content

Look Up / Look Up Replace

Syntax​

Look Up database_name
Look Up Replace

In entries.ini (optional companions):

Look Up database_name
Auto Add
Search Entire Field
Look Up Replace

Parameters​

ParameterDescription
database_nameThe name of the lookup database file without extension (e.g., ZIP for ZIP.DTA)
Look Up ReplaceOverwrites existing field values with looked-up data instead of preserving them
Auto Add(entries.ini) Automatically adds new entries to the lookup database when an unmatched key is encountered
Search Entire Field(entries.ini) Forces matching against the full field length instead of a prefix match

Description​

Look Up retrieves information from another database and fills in fields based on a key match. For example, looking up a ZIP code to auto-fill city and state. Look Up Replace overwrites existing data with the looked-up values.

The lookup source is a separate RunScore .DTA file in the race folder (historically called a "look up database" in the old manual — not a distinct command).

Remarks​

  • Works in both .lst listing files and entries.ini.
  • Without Replace, existing non-empty field values are preserved.
  • With Look Up Replace, existing data is overwritten by the looked-up values.
  • The key field (e.g., ZIP) must exist in both the main database and the lookup database; matched fields fill by name.
  • The lookup database file (e.g., ZIP.DTA) must be in the race folder.

Examples​

Look up city and state from a ZIP code database:

Look Up ZIP

Overwrite existing values with looked-up data:

Look Up Replace
Look Up ZIP

In entries.ini:

LOOK UP ZIP

The built-in ZIP code lookup database​

RunScore ships a ready-to-use USA ZIP-code lookup database. To use it, add this line to entries.ini:

Look Up ..\common\zip

This points at the shared Zip.DTA in the RunScore installation's common folder, used by every race. To keep a per-race copy instead, or to build a lookup database for something other than ZIP codes, the file needs:

  • A field named the same as the key you're looking up (e.g. ZIP), and it must be the first field in the database.
  • Any additional fields you want copied over (e.g. CITY, STATE).

Copy ZIP.FRM from the Sample race folder as a starting layout if you don't already have a database.

Partial-key matching​

A key doesn't have to be matched in full — RunScore matches on however many characters the lookup entry has stored. For example, if Binghamton, NY covers ZIP codes 13901–13905, store just 1390 as the key with Binghamton/NY as the looked-up values; any ZIP code starting with 1390 matches it. This is also how the lookup mechanism supports keys other than ZIP codes — team codes, or a first-name-to-gender list, for example.