home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / pdoxde / pxmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  5.6 KB  |  208 lines

  1. VERSION 2.00
  2. Begin Form pdox1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Paradox Engine Testing Sheet"
  5.    ClientHeight    =   3765
  6.    ClientLeft      =   1320
  7.    ClientTop       =   1950
  8.    ClientWidth     =   7545
  9.    Height          =   4455
  10.    Icon            =   PXMAIN.FRX:0000
  11.    Left            =   1260
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   3765
  15.    ScaleWidth      =   7545
  16.    Top             =   1320
  17.    Width           =   7665
  18.    Begin PictureBox Picture1 
  19.       BackColor       =   &H00004040&
  20.       Height          =   375
  21.       Left            =   1200
  22.       ScaleHeight     =   345
  23.       ScaleWidth      =   5385
  24.       TabIndex        =   11
  25.       Top             =   3120
  26.       Width           =   5415
  27.    End
  28.    Begin TextBox recdisp 
  29.       BackColor       =   &H0000FFFF&
  30.       ForeColor       =   &H00FF0000&
  31.       Height          =   375
  32.       Left            =   1080
  33.       TabIndex        =   10
  34.       Top             =   3000
  35.       Width           =   5415
  36.    End
  37.    Begin CommandButton prevbtn 
  38.       Caption         =   "prev"
  39.       Height          =   495
  40.       Left            =   5280
  41.       TabIndex        =   3
  42.       Top             =   1800
  43.       Width           =   975
  44.    End
  45.    Begin CommandButton nextbtn 
  46.       Caption         =   "next"
  47.       Height          =   495
  48.       Left            =   5280
  49.       TabIndex        =   2
  50.       Top             =   1080
  51.       Width           =   975
  52.    End
  53.    Begin ListBox flddisp 
  54.       BackColor       =   &H0000FFFF&
  55.       ForeColor       =   &H00FF0000&
  56.       Height          =   1395
  57.       Left            =   1080
  58.       TabIndex        =   6
  59.       Top             =   1080
  60.       Width           =   3375
  61.    End
  62.    Begin CommandButton exitbtn 
  63.       Caption         =   "exit"
  64.       Height          =   1215
  65.       Left            =   6600
  66.       TabIndex        =   5
  67.       Top             =   720
  68.       Width           =   615
  69.    End
  70.    Begin CommandButton openbtn 
  71.       Caption         =   "open"
  72.       Default         =   -1  'True
  73.       Height          =   495
  74.       Left            =   5280
  75.       TabIndex        =   1
  76.       Top             =   360
  77.       Width           =   975
  78.    End
  79.    Begin TextBox filename 
  80.       BackColor       =   &H00FFFF00&
  81.       ForeColor       =   &H00FF0000&
  82.       Height          =   375
  83.       Left            =   1080
  84.       TabIndex        =   0
  85.       Top             =   360
  86.       Width           =   3015
  87.    End
  88.    Begin Label Label4 
  89.       BackColor       =   &H00C0C0C0&
  90.       Caption         =   "field"
  91.       Height          =   255
  92.       Left            =   360
  93.       TabIndex        =   9
  94.       Top             =   3000
  95.       Width           =   495
  96.    End
  97.    Begin Label Label3 
  98.       BackColor       =   &H00C0C0C0&
  99.       Caption         =   "names"
  100.       Height          =   255
  101.       Left            =   360
  102.       TabIndex        =   8
  103.       Top             =   1560
  104.       Width           =   615
  105.    End
  106.    Begin Label Label1 
  107.       BackColor       =   &H00C0C0C0&
  108.       Caption         =   "field"
  109.       Height          =   255
  110.       Left            =   360
  111.       TabIndex        =   7
  112.       Top             =   1320
  113.       Width           =   495
  114.    End
  115.    Begin Label Label2 
  116.       BackColor       =   &H00C0C0C0&
  117.       Caption         =   "table"
  118.       Height          =   255
  119.       Left            =   360
  120.       TabIndex        =   4
  121.       Top             =   480
  122.       Width           =   495
  123.    End
  124.    Begin Menu aboutpx 
  125.       Caption         =   "&About"
  126.    End
  127.    Begin Menu dbase 
  128.       Caption         =   "&Database"
  129.    End
  130. Dim pxtbl As Integer
  131. Dim pxrec As Integer
  132. Dim pxfld As Integer
  133. Dim pxFType As String * 255
  134. Dim initflag As Integer
  135. Sub aboutpx_Click ()
  136.     pxabout.Show
  137. End Sub
  138. Sub dbase_Click ()
  139.     Do While flddisp.listcount
  140.        flddisp.RemoveItem 0
  141.     Loop
  142.     recdisp.text = ""
  143.     FileForm.Show
  144. End Sub
  145. Sub exitbtn_Click ()
  146.     rc = PXExit()
  147.     PXError
  148.     End
  149. End Sub
  150. Sub flddisp_Click ()
  151.     pxfld = pdox1.flddisp.ListIndex + 1
  152.     rc = pxFldType(pxtbl, pxfld, 10, pxFType)
  153.     PXError
  154.     GetField pxrec, pxfld, pxFType
  155.     recdisp.text = RTrim$(returnfld)
  156. End Sub
  157. Sub nextbtn_Click ()
  158.     PXNext pxtbl, pxrec
  159.     PXError
  160.     pxfld = pdox1.flddisp.ListIndex + 1
  161.     rc = pxFldType(pxtbl, pxfld, 10, pxFType)
  162.     PXError
  163.     GetField pxrec, pxfld, pxFType
  164.     recdisp.text = returnfld
  165. End Sub
  166. Sub openbtn_CLICK ()
  167.     Dim apName As String
  168.     Dim x As Integer
  169.     apName = "pxtest"
  170.     If initflag = 0 Then
  171.         PXInit apName, PXSHARED
  172.         initflag = 1
  173.     Else
  174.         Do While flddisp.listcount
  175.             flddisp.RemoveItem 0
  176.         Loop
  177.         rc = PXTblClose(pxtbl)
  178.         PXError
  179.     End If
  180.     tIndex = 0 'set open to master table
  181.     pxname$ = RTrim$(filename.text)
  182.     PXOpen pxname$, pxtbl, pxrec
  183.     rc = PXRecNFlds(pxtbl, nFlds)
  184.     PXError
  185.     recdisp.text = "total number of fields: " + Str$(nFlds)
  186.     For x = 1 To nFlds
  187.         rc = PXFldName(pxtbl, x, 255, fldname)
  188.         PXError
  189.         rc = pxFldType(pxtbl, x, 255, pxFType)
  190.         PXError
  191.         fldText$ = LTrim$(RTrim$(fldname)) + " : " + LTrim$(RTrim$(pxFType))
  192.         pdox1.flddisp.AddItem fldText$
  193.     Next x
  194.     rc = PXRecFirst(pxtbl)
  195.     PXError
  196.     rc = PXRecGet(pxtbl, pxrec)
  197.     PXError
  198. End Sub
  199. Sub prevbtn_Click ()
  200.     PXPrev pxtbl, pxrec
  201.     PXError
  202.     pxfld = pdox1.flddisp.ListIndex + 1
  203.     rc = pxFldType(pxtbl, pxfld, 10, pxFType)
  204.     PXError
  205.     GetField pxrec, pxfld, pxFType
  206.     recdisp.text = returnfld
  207. End Sub
  208.