TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: GARY PRICE
from: BRIAN MCLAUGHLIN
date: 1995-10-26 08:27:00
subject: Hashing in PowerBASIC 4/4

>>> Continued from previous message
                PRINT : PRINT "Not enough room in word table!"
                END
            END IF
            EXIT SUB
        'is this what we're looking for?
        ELSEIF WordTable$(KeyIndex) = A$ THEN
            'increment the frequency of the entry
            Counts(KeyIndex) = Counts(KeyIndex) + 1
            EXIT SUB
        'this entry contains a string other than what we're looking for:
        'adjust the KeyIndex and try again
        ELSE
            collisions = collisions + 1
            LOCATE 5, 1: PRINT "Collisions: "; collisions
            KeyIndex = KeyIndex - Offset
            'wrap back the keyindex if it's <0
            IF KeyIndex < 0 THEN
                KeyIndex = KeyIndex + TableSize
            END IF
        END IF
    LOOP
END SUB
=======>8 SAMPLE 5.0 ENDS HERE 8<=========
 * SLMR 2.1a * MAXLIB For PB v1.2 - Access arrays and files in EMS/XMS!
--- WILDMAIL!/WC v4.12 
---------------
* Origin: Com-Dat BBS - Hillsboro, OR. HST DS (1:105/314.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.