=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-22-93 (14:23) Number: 184 From: QUINN TYLER JACKSON Refer#: NONE To: CORIDON HENSHAW Recvd: NO Subj: Hashed NODELIST 3/ Conf: (35) Quick Basi --------------------------------------------------------------------------- >>> Continued from previous message END SELECT CASE "R" Idx.Region = VAL(NodelistBuffer(1)) CASE "Z" Idx.Zone = VAL(NodelistBuffer(1)) CASE ELSE GOTO JumpPast END SELECT REDIM NodelistBuffer(0 TO 7) AS STRING * 50 items = items + 1 Hidx.Kee = fqjAdd2Kee(Idx.Zone, Idx.Net, Idx.Node, 0) Hidx.Offset = SEEK(NodeListHandle) sqjHashPut Hidx JumpPast: LOOP UNTIL EOF(NodeListHandle) PRINT INT(TIMER - StartTime! + .5); "seconds for"; items; " items." END SUB REM $STATIC SUB sqjHashPut (Idx AS HashIdxType) 'Find the expected position of the word. Position = frgHashIdent(Idx, Offset) 'If another entry lies in the expected position 'then retry by looking further down the table. GET #HashHandle, Position, Buffer DO WHILE (Buffer.Kee <> STRING$(8, 0)) Position = Position - Offset 'If position falls below the beginning of the 'table then wrap back to the end. IF Position < 0 THEN Position = Position + MaxHash GET #HashHandle, Position, Buffer LOOP 'Store the word in the hash table. PUT #HashHandle, Position, Idx END SUB SUB sqjOpenHash (FileName$) DIM Empty AS HashIdxType HashHandle = FREEFILE OPEN FileName$ FOR RANDOM AS HashHandle LEN = LEN(Buffer) FOR i = 1 TO MaxHash PUT #HashHandle, i, Empty NEXT i END SUB ________O_/________________________| SNIP |______________________\_O_______ O \ | HERE | / O * OLX 2.1 TD * The plural of programmer is insomnia.... --- Maximus/2 2.01wb * Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20