Branches #6 declared that any items left over after FAST.BUILD is finished have to be added to a B-tree with the usual BTPINS calls. How is that done?
One way is to put a loop at the end of FAST.BUILD that essentially does a BUILD for any remaining items. Insert the statement
100 READNEXT ITEM.ID ELSEafter line 44 in FAST.BUILD, then append the statements
READ ITEM FROM DFILE, ITEM.ID ELSE GOTO 100 CALL BTPINS(BTNAME,SIZE,BFILE,DFILE,ITEM.ID,ITEM) KEYS=KEYS+1 ; GOTO 100 ENDat the end of FAST.BUILD, after line 47. Since a DFILE is now required, insert the statements
CRT "What data file does the B-tree index": INPUT DNAME OPEN DNAME TO DFILE ELSE STOP "No such file!"after line 4.
The above changes cause FAST.BUILD to execute as usual, but then it falls into a loop calling BTPINS like the original BUILD program. Note that once BTPINS is called by FAST.BUILD to insert all remaining items, the same chosen SIZE number must be used for all subsequent BTPINS and BTPDEL calls.