home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdb / indexdem.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  4.0 KB  |  147 lines

  1. VERSION 2.00
  2. Begin Form BrowseNDX 
  3.    Caption         =   "Demo GetKEY"
  4.    ClientHeight    =   2865
  5.    ClientLeft      =   2355
  6.    ClientTop       =   2400
  7.    ClientWidth     =   4875
  8.    Height          =   3270
  9.    Left            =   2295
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2865
  13.    ScaleWidth      =   4875
  14.    Top             =   2055
  15.    Width           =   4995
  16.    Begin TextBox DispTime 
  17.       Height          =   492
  18.       Left            =   3240
  19.       TabIndex        =   12
  20.       Text            =   "Text5"
  21.       Top             =   2280
  22.       Width           =   732
  23.    End
  24.    Begin CommandButton Command1 
  25.       Caption         =   "E&xit"
  26.       Height          =   492
  27.       Left            =   480
  28.       TabIndex        =   2
  29.       Top             =   2280
  30.       Width           =   1092
  31.    End
  32.    Begin TextBox Text4 
  33.       BackColor       =   &H00C0C0C0&
  34.       Enabled         =   0   'False
  35.       Height          =   732
  36.       Left            =   0
  37.       TabIndex        =   10
  38.       Top             =   2160
  39.       Width           =   5292
  40.    End
  41.    Begin TextBox Text3 
  42.       Height          =   372
  43.       Left            =   120
  44.       TabIndex        =   5
  45.       Top             =   1680
  46.       Width           =   4692
  47.    End
  48.    Begin TextBox Text1 
  49.       Height          =   372
  50.       Left            =   1800
  51.       TabIndex        =   1
  52.       Top             =   720
  53.       Width           =   852
  54.    End
  55.    Begin TextBox Text2 
  56.       Height          =   372
  57.       Left            =   120
  58.       TabIndex        =   0
  59.       Top             =   360
  60.       Width           =   2532
  61.    End
  62.    Begin Frame Frame1 
  63.       Caption         =   "&Key Control"
  64.       Height          =   1008
  65.       Left            =   2832
  66.       TabIndex        =   7
  67.       Top             =   120
  68.       Width           =   1872
  69.       Begin CheckBox Check2 
  70.          Caption         =   "&Proximate"
  71.          Height          =   372
  72.          Left            =   240
  73.          TabIndex        =   9
  74.          Top             =   600
  75.          Width           =   1092
  76.       End
  77.       Begin CheckBox Check1 
  78.          Caption         =   "&Exact"
  79.          Height          =   372
  80.          Left            =   240
  81.          TabIndex        =   8
  82.          Top             =   240
  83.          Width           =   1092
  84.       End
  85.    End
  86.    Begin Label Label4 
  87.       Alignment       =   1  'Right Justify
  88.       BackColor       =   &H00C0C0C0&
  89.       Caption         =   "time to get key:"
  90.       Height          =   492
  91.       Left            =   2040
  92.       TabIndex        =   11
  93.       Top             =   2280
  94.       Width           =   1092
  95.    End
  96.    Begin Label Label3 
  97.       Caption         =   "Key found"
  98.       Height          =   204
  99.       Left            =   120
  100.       TabIndex        =   6
  101.       Top             =   1440
  102.       Width           =   2040
  103.    End
  104.    Begin Label Label2 
  105.       Alignment       =   1  'Right Justify
  106.       Caption         =   "Index record no. "
  107.       Height          =   264
  108.       Left            =   240
  109.       TabIndex        =   4
  110.       Top             =   840
  111.       Width           =   1500
  112.    End
  113.    Begin Label Label1 
  114.       Caption         =   "Enter key data to find"
  115.       Height          =   204
  116.       Left            =   108
  117.       TabIndex        =   3
  118.       Top             =   108
  119.       Width           =   2052
  120.    End
  121.     DefInt A-Z
  122.     Dim Index As Integer
  123. Sub Command1_Click ()
  124.     Unload BrowseNDX
  125. End Sub
  126. Sub Form_Click ()
  127.     End
  128. End Sub
  129. Sub Text2_KeyPress (KeyAscii As Integer)
  130.     If KeyAscii = 13 Then
  131.         
  132.         Key$ = Text2.Text
  133.         Mode = 0        'best match
  134.         
  135.         InTime# = Timer
  136.         
  137.         GetKEY NDXHandle, Status, Key$, Record&, Mode
  138.         OuTime# = Timer
  139.         DispTime.Text = Str$(OuTime# - InTime#)
  140.         Text1.Text = Str$(Record&)
  141.         Text3.Text = Key$
  142.         
  143.         KeyAscii = 0
  144.     End If
  145.         
  146. End Sub
  147.