home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
database
/
vpi1_303.arj
/
RELATION.PRG
< prev
next >
Wrap
Text File
|
1991-12-30
|
2KB
|
45 lines
**********************************************************************
** RELATION.PRG
** (C) Copyright 1990-92, Sub Rosa Publishing Inc.
**
** A demonstration program provided to VP-Info users.
** This program may be copied freely. If it is used in commercial code,
** please credit the source, Sub Rosa Publishing Inc.
**
** RELATION demonstrates use of two related data files and the
** FIND command
**
** RELATION is compatible with all current versions of VP-Info.
**
** MASTRAN and CUSTLIST are both indexed on the customer number.
** A record is found in MASTRAN by having the user enter a customer
** number into FINDER. If a matching record is found, # will equal
** :NEAR, but if not, the program positions on :NEAR, the first record
** greater than the FIND key.
**
** During BROWSE, every time a new record is shown, the matching
** record in CUSTLIST is shown as well and, if changed, updates
** the contents of CUSTLIST.
**
** Sid Bursten and Bernie Melman
**********************************************************************
SET talk off
USE mastran index mastran
USE#2 custlist index custlist
SET relation on cust_no to 2
DO WHILE t
CLS
ACCEPT 'Enter a customer number (leave blank to quit). . . ' to finder
IF finder=' '
BREAK
ENDIF
FIND &finder
IF #<>:NEAR ;:NEAR equals record number if successful
GOTO :NEAR
ENDIF
BROWSE cust_no,amount,dayout,cust_no#2,fname#2,name#2,address#2,city#2
ENDDO
CHAIN samples
*
* *** end of program RELATION.PRG ***