home *** CD-ROM | disk | FTP | other *** search
- /* Relational look-up
- * ARrexx script for db showing how simple relations can be implemented.
- * By David Ekholm 1995
- * $VER: look-up.db 1.0 (13.9.95)
- *
- * To create your own relations, just modify the two lines below
- */
-
- file = 'CD'
- key = 'CD #'
-
- /* 'file' indicates what file to do the look-up in. 'key' is the field to
- * look into. This scripts expects the portname to be 'file'.1
- * It also assumes the key fieldname to be the same in the two databases.
- */
-
- port = file || '.1'
-
- Options Results
-
- GetField key
- keyval = result
-
- if find(show('p'), port) == 0 then do
- address command 'run //db ' file
- address COMMAND WaitForPort port
- ActivateWindow /* Reactivate the old window */
- end
-
- address VALUE port
- BlockInput /* Do this silently */
- Mode 'find'
- Kill
- CurrentField key
- PutField keyval
- FindFirst
- if RC == 5 then do
- DisplayBeep
- Okay1 key keyval 'can''t be found in the ' file 'database!'
- end
- FreeInput
-