LOOKUP( ) Function Example

In the following example, LOOKUP( ) uses the index tag company to search for the first occurrence of the string "Ernst Handel." If the search is successful, LOOKUP( ) returns the contents of the contact field and @ ... SAY displays the return value.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'data\testdata')
USE customer ORDER company  && Open Customer table
CLEAR
@ 2,2 SAY LOOKUP(contact, 'Ernst Handel', company, 'company')