vbdpss.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Article Q83857, Example
                                                 Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
                           Knowledge Base Contents  Knowledge Base Index
 
 How an ISAM SEEK Works with Multiple Indexes - Q83857
 
 Code Example
 -------------
 
 ' To try this example in VBDOS.EXE:
 ' 1. From the File menu, choose New Project.
 ' 2. Copy the code example to the Code window.
 ' 3. Press F5 to run the program.
 
 DEFINT A-Z
 DATA 1,1,1,2,1,3
 
 TYPE RecordType             'Declares the ISAM record.
     First AS INTEGER
     Second AS INTEGER
 END TYPE
 
 DIM record AS RecordType
 
 OPEN "test.db" FOR ISAM RecordType "SeekTest" AS #1
 CREATEINDEX 1, "all", 0, "First", "Second"
 SETINDEX 1, "all"
 
 FOR count% = 1 TO 3
   READ record.First, record.Second
   INSERT #1, record     ' Inserts three records into the database.
 NEXT count%
 
 SEEKGT #1, 1, 1
 WHILE NOT EOF(1)
    RETRIEVE #1, record  ' The first record that is retrieved is the
                         ' the record that contains a 1 in the first
                         ' field and a 2 in the second field.
    PRINT "First "; record.First; "   Second ";record.Second
    MOVENEXT #1
 WEND
 
 END