home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / vb / pxengine / pxengine.txt next >
Encoding:
Text File  |  1992-06-01  |  38.2 KB  |  1,109 lines

  1. ' Visual Basic declarations for Paradox Engine Version 2.0
  2. '
  3. ' Functions PXInit, PXNetInit & PXSetHWHandler not used under Windows.
  4. '
  5. ' Initialization and finalization functions
  6. '
  7. Declare Function PXWinInit Lib "pxengwin.dll" (ByVal clientName$, ByVal ShareMode%) As Integer
  8. Declare Function PXExit Lib "pxengwin.dll" () As Integer
  9. Declare Function PXSetDefaults Lib "pxengwin.dll" (ByVal Bufsize%, ByVal MaxTables%, ByVal MaxRecBufs%, ByVal MaxLocks%, ByVal MaxFiles%, ByVal SortOrder%) As Integer
  10. Declare Function PXGetDefaults Lib "pxengwin.dll" (Swapsize%, MaxTables%, MaxRecBufs%, MaxLocks%, MaxFiles%, sortTable%) As Integer
  11. '
  12. ' Utility Functions
  13. '
  14. Declare Function ISBLANKDOUBLE Lib "pxengwin.dll" (ByVal x#) As Integer
  15. Declare Sub BLANKDOUBLE Lib "pxengwin.dll" (x#)
  16. '
  17. ' Table Functions
  18. '
  19. Declare Function PXTblOpen Lib "pxengwin.dll" (ByVal TblName$, ptblHandle%, ByVal indexID%, ByVal saveEveryChange%) As Integer
  20. Declare Function PXTblClose Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  21. Declare Function PXTblCreate Lib "pxengwin.dll" (ByVal TblName$, ByVal nFields%, fields&, types&) As Integer
  22. Declare Function PXTblEmpty Lib "pxengwin.dll" (ByVal TblName$) As Integer
  23. Declare Function PXTblDelete Lib "pxengwin.dll" (ByVal TblName$) As Integer
  24. Declare Function PXTblCopy Lib "pxengwin.dll" (ByVal fromName$, ByVal toName$) As Integer
  25. Declare Function PXTblRename Lib "pxengwin.dll" (ByVal fromName$, ByVal toName$) As Integer
  26. Declare Function PXTblAdd Lib "pxengwin.dll" (ByVal srcName$, ByVal destName$) As Integer
  27. '
  28. ' Record Functions
  29. '
  30. Declare Function PXRecAppend Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%) As Integer
  31. Declare Function PXRecInsert Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%) As Integer
  32. Declare Function PXRecUpdate Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%) As Integer
  33. Declare Function PXRecDelete Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  34. Declare Function PXRecBufOpen Lib "pxengwin.dll" (ByVal TblHandle%, precHandle%) As Integer
  35. Declare Function PXRecBufClose Lib "pxengwin.dll" (ByVal RecHandle%) As Integer
  36. Declare Function PXRecBufEmpty Lib "pxengwin.dll" (ByVal RecHandle%) As Integer
  37. Declare Function PXRecBufCopy Lib "pxengwin.dll" (ByVal fromHandle%, ByVal toHandle%) As Integer
  38. Declare Function PXRecGet Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%) As Integer
  39. '
  40. ' Field Functions
  41. '
  42. Declare Function PXPutShort Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal value%) As Integer
  43. Declare Function PXPutDoub Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal value#) As Integer
  44. Declare Function PXPutLong Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal value&) As Integer
  45. Declare Function PXPutAlpha Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal value$) As Integer
  46. Declare Function PXPutDate Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal value&) As Integer
  47. Declare Function PXPutBlank Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%) As Integer
  48. Declare Function PXGetShort Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, SValue%) As Integer
  49. Declare Function PXGetDoub Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, Dvalue#) As Integer
  50. Declare Function PXGetLong Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, LValue&) As Integer
  51. Declare Function PXGetAlpha Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, ByVal Bufsize%, ByVal dest$) As Integer
  52. Declare Function PXGetDate Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, pvalue&) As Integer
  53. Declare Function PXFldBlank Lib "pxengwin.dll" (ByVal RecHandle%, ByVal FldHandle%, Blank%) As Integer
  54. Declare Function PXRecGoto Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecNum&) As Integer
  55. Declare Function PXRecFirst Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  56. Declare Function PXRecLast Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  57. Declare Function PXRecNext Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  58. Declare Function PXRecPrev Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  59. '
  60. ' Index Functions
  61. '
  62. Declare Function PXKeyAdd Lib "pxengwin.dll" (ByVal TblName$, ByVal NFlds%, pfldHandles%, ByVal mode%) As Integer
  63. Declare Function PXKeyDrop Lib "pxengwin.dll" (ByVal TblName$, ByVal indexID%) As Integer
  64. '
  65. ' Date Functions
  66. '
  67. Declare Function PXDateDecode Lib "pxengwin.dll" (ByVal PXdate&, Mo%, Da%, Yr%) As Integer
  68. Declare Function PXDateEncode Lib "pxengwin.dll" (ByVal Mo%, ByVal Da%, ByVal Yr%, pdate&) As Integer
  69. '
  70. ' Search Functions
  71. '
  72. Declare Function PXSrchKey Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%, ByVal NFlds%, ByVal mode%) As Integer
  73. Declare Function PXSrchFld Lib "pxengwin.dll" (ByVal TblHandle%, ByVal RecHandle%, ByVal FldHandle%, ByVal mode%) As Integer
  74. '
  75. ' Password Functions
  76. '
  77. Declare Function PXTblProtected Lib "pxengwin.dll" (ByVal TblName$, Protected%) As Integer
  78. Declare Function PXPswAdd Lib "pxengwin.dll" (ByVal Password$) As Integer
  79. Declare Function PXPswDel Lib "pxengwin.dll" (ByVal Password$) As Integer
  80. Declare Function PXTblEncrypt Lib "pxengwin.dll" (ByVal TblName$, ByVal Password$) As Integer
  81. Declare Function PXTblDecrypt Lib "pxengwin.dll" (ByVal TblName$) As Integer
  82. '
  83. ' Informational Functions
  84. '
  85. Declare Function PXTblExist Lib "pxengwin.dll" (ByVal TblName$, Exist%) As Integer
  86. Declare Function PXTblName Lib "pxengwin.dll" (ByVal TblHandle%, ByVal Bufsize%, ByVal TblName$) As Integer
  87. Declare Function PXRecNum Lib "pxengwin.dll" (ByVal TblHandle%, precnum&) As Integer
  88. Declare Function PXTblNRecs Lib "pxengwin.dll" (ByVal TblHandle%, pnRecs&) As Integer
  89. Declare Function PXRecNFlds Lib "pxengwin.dll" (ByVal TblHandle%, NFlds%) As Integer
  90. Declare Function PXKeyNFlds Lib "pxengwin.dll" (ByVal TblHandle%, nKeyFlds%) As Integer
  91. Declare Function PXFldHandle Lib "pxengwin.dll" (ByVal TblHandle%, ByVal FieldName$, pfldHandle%) As Integer
  92. Declare Function PXFldType Lib "pxengwin.dll" (ByVal TblHandle%, ByVal FldHandle%, ByVal Bufsize%, ByVal FldType$) As Integer
  93. Declare Function PXFldName Lib "pxengwin.dll" (ByVal TblHandle%, ByVal FldHandle%, ByVal Bufsize%, ByVal FldName$) As Integer
  94. '
  95. ' Miscellaneous Functions
  96. '
  97. Declare Function PXTblMaxSize Lib "pxengwin.dll" (ByVal maxsize%) As Integer
  98. Declare Function PXSave Lib "pxengwin.dll" () As Integer
  99. '
  100. ' Concurrency Functions
  101. ' can be used only if PXWinInit() was successful
  102. '
  103. Declare Function PXNetUserName Lib "pxengwin.dll" (ByVal Bufsize%, ByVal UserName$) As Integer
  104. Declare Function PXNetFileLock Lib "pxengwin.dll" (ByVal fileName$, ByVal lockType%) As Integer
  105. Declare Function PXNetFileUnlock Lib "pxengwin.dll" (ByVal fileName$, ByVal lockType%) As Integer
  106. Declare Function PXNetTblLock Lib "pxengwin.dll" (ByVal TblHandle%, ByVal lockType%) As Integer
  107. Declare Function PXNetTblUnlock Lib "pxengwin.dll" (ByVal TblHandle%, ByVal lockType%) As Integer
  108. Declare Function PXNetRecLock Lib "pxengwin.dll" (ByVal TblHandle%, plckHandle%) As Integer
  109. Declare Function PXNetRecUnlock Lib "pxengwin.dll" (ByVal TblHandle%, ByVal lckHandle%) As Integer
  110. Declare Function PXNetRecLocked Lib "pxengwin.dll" (ByVal TblHandle%, Locked%) As Integer
  111. Declare Function PXNetRecGotoLock Lib "pxengwin.dll" (ByVal TblHandle%, ByVal lckHandle%) As Integer
  112. Declare Function PXNetTblChanged Lib "pxengwin.dll" (ByVal TblHandle%, Changed%) As Integer
  113. Declare Function PXNetTblRefresh Lib "pxengwin.dll" (ByVal TblHandle%) As Integer
  114. '
  115. ' Error Functions
  116. '
  117. Declare Function PXErrMsg Lib "pxengwin.dll" (ByVal errCode%) As Long
  118. Declare Function PXNetErrUser Lib "pxengwin.dll" (ByVal Bufsize%, ByVal UserName$) As Integer
  119. '
  120. ' SortOrder argument in PXSetDefaults
  121. '
  122. Const SortOrderAscii = "a"        'ASCII sort order
  123. Const SortOrderIntl = "i"         'International sort order
  124. Const SortOrderNorDan = "n"       'Norwegian/Danish sort order
  125. Const SortOrderSwedFin = "s"      'Swedish/Finnish sort order
  126. '
  127. ' Mode argument in PXKeyAdd
  128. '
  129. Const PRIMARY% = 0                'Primary index (key)
  130. Const SECONDARY% = 1              'Not maintained secondary index
  131. Const INCSECONDARY% = 2           'Maintained secondary index
  132. '
  133. ' Mode argument in PXSrchFld & PXSrchKey
  134. '
  135. Const SEARCHFIRST% = 0            'Search from beginning of table
  136. Const SEARCHNEXT% = 1             'Search from next record in table
  137. Const CLOSESTRECORD% = 2          '(modifier) goto 'nearest' record if
  138. '                                  no match found (ordered fields only)
  139. ' LockType argument in
  140. ' PXNetFileLock, PXNetFileUnlock, PXNetTblLock & PXNetTblUnlock
  141. '
  142. Const FL% = 1                     'Full lock, no concurrency
  143. Const WL% = 2                     'Write lock
  144. Const PWL% = 3                    'Prevent write lock
  145. Const PFL% = 4                    'Prevent full lock, full concurrency
  146. '
  147. ' ShareMode argument in PXWinInit
  148. '
  149. Const PXSINGLECLIENT% = 0         'Allow no other client access to Engine DLL
  150. Const PXEXCLUSIVE% = 1            'Open all tables with FULL LOCK
  151. Const PXSHARED% = 2               'Open all tables with PREVENT FULL LOCK
  152. '
  153. ' Miscellaneous declarations
  154. '
  155. Const InternalVersion& = &H2000004 'Paradox Engine version number
  156. Dim BLANKALPHA As String           'Blank string
  157. Dim BLANKDATE As Long              'Blank date
  158. Dim BLANKLONG As Long              'Blank long integer
  159. Dim BLANKSHORT As Integer          'Blank short integer
  160. '
  161. ' Paradox Engine return codes
  162. '
  163. Const PXSUCCESS% = 0
  164. Const PXERR_DRIVENOTREADY% = 1
  165. Const PXERR_DIRNOTFOUND% = 2
  166. Const PXERR_FILEBUSY% = 3
  167. Const PXERR_FILELOCKED% = 4
  168. Const PXERR_FILENOTFOUND% = 5
  169. Const PXERR_TABLECORRUPTED% = 6
  170. Const PXERR_XCORRUPTED% = 7
  171. Const PXERR_XOUTOFDATE% = 8
  172. Const PXERR_RECLOCKED% = 9
  173. Const PXERR_DIRBUSY% = 10
  174. Const PXERR_DIRLOCKED% = 11
  175. Const PXERR_DIRNOACCESS% = 12
  176. Const PXERR_XSORTVERSION% = 13
  177. Const PXERR_DIRNOTPRIVATE% = 14
  178. Const PXERR_NETMULTIPLE% = 15
  179. Const PXERR_INSUFRIGHTS% = 21
  180. Const PXERR_TABLEWRITEPRO% = 22
  181. Const PXERR_TYPEMISMATCH% = 30
  182. Const PXERR_OUTOFRANGE% = 31
  183. Const PXERR_INVPARAMETER% = 33
  184. Const PXERR_OUTOFMEM% = 40
  185. Const PXERR_OUTOFDISK% = 41
  186. Const PXERR_RECDELETED% = 50
  187. Const PXERR_OUTOFFILEHANDLES% = 70
  188. Const PXERR_OUTOFTABLEHANDLES% = 72
  189. Const PXERR_INVDATE% = 73
  190. Const PXERR_INVFIELDNAME% = 74
  191. Const PXERR_INVFIELDHANDLE% = 75
  192. Const PXERR_INVTABLEHANDLE% = 76
  193. Const PXERR_NOTINITERR% = 78
  194. Const PXERR_INVENGINESTATE% = 79
  195. Const PXERR_STRUCTDIFFER% = 81
  196. Const PXERR_ALREADYINIT% = 82
  197. Const PXERR_TABLEOPEN% = 83
  198. Const PXERR_NOMORETMPNAMES% = 86
  199. Const PXERR_RECNOTFOUND% = 89
  200. Const PXERR_TABLEINDEXED% = 94
  201. Const PXERR_TABLENOTINDEXED% = 95
  202. Const PXERR_SXOUTOFDATE% = 96
  203. Const PXERR_KEYVIOL% = 97
  204. Const PXERR_NOTLOGGEDIN% = 98
  205. Const PXERR_INVTABLENAME% = 99
  206. Const PXERR_ENDOFTABLE% = 101
  207. Const PXERR_STARTOFTABLE% = 102
  208. Const PXERR_OUTOFRECHANDLES% = 103
  209. Const PXERR_INVRECHANDLE% = 104
  210. Const PXERR_TABLEEMPTY% = 105
  211. Const PXERR_INVLOCKCODE% = 106
  212. Const PXERR_NONETINIT% = 107
  213. Const PXERR_INVFILENAME% = 108
  214. Const PXERR_INVUNLOCK% = 109
  215. Const PXERR_INVLOCKHANDLE% = 110
  216. Const PXERR_OUTOFLOCKHANDLES% = 111
  217. Const PXERR_INVSORTORDER% = 112
  218. Const PXERR_INVNETTYPE% = 113
  219. Const PXERR_INVDIRNAME% = 114
  220. Const PXERR_TOOMANYPASSW% = 115
  221. Const PXERR_INVPASSW% = 116
  222. Const PXERR_BUFTOOSMALL% = 117
  223. Const PXERR_TABLEBUSY% = 118
  224. Const PXERR_TABLELOCKED% = 119
  225. Const PXERR_TABLENOTFOUND% = 120
  226. Const PXERR_SXNOTFOUND% = 121
  227. Const PXERR_SXCORRUPTED% = 122
  228. Const PXERR_SXOPEN% = 123
  229. Const PXERR_DISKWRITEPRO% = 124
  230. Const PXERR_RECTOOBIG% = 125
  231. Const PXERR_GENERALFAILURE% = 126
  232. Const PXERR_OUTOFSTACK% = 127
  233. Const PXERR_TABLEFULL% = 128
  234. Const PXERR_OUTOFSWAPBUF% = 129
  235. Const PXERR_TABLESQL% = 130
  236. Const PXERR_TOOMANYCLIENTS% = 131
  237. Const PXERR_EXCEEDSCONFIGLIMITS% = 132
  238. Const PXERR_CANTREMAPFILEHANDLE% = 133
  239. Const PXERR_CANTSHAREPDOXNET% = 134
  240. Const PXERR_WINDOWSREALMODE% = 135
  241. Const PXERR_SXCANTUPDATE% = 136
  242. '
  243. ' Paradox Engine message variables
  244. '
  245. Dim RC As Integer                 'Paradox Engine return code
  246. Dim PXMsgPtr As Long              'Paradox Engine message address
  247. Dim PXMsgLen As Integer           'Paradox Engine message length
  248. Dim PXMsgTxt As String            'Paradox Engine message text
  249. Dim Dummy As Long                 'Dummy work variable
  250. '
  251. ' Windows API function declarations
  252. '
  253. Declare Function AnsiPrev Lib "User" (ByVal lpchStart As String, ByVal lpchCurrentChar As String) As Long
  254. Declare Function lstrcpy Lib "Kernel" (ByVal lpszString1 As Any, ByVal lpszString2 As Any) As Long
  255. Declare Function lstrlen Lib "Kernel" (ByVal lpszString As Any) As Integer
  256. '
  257. ' Dynamic array declarations
  258. '
  259. Dim Field_Name() As Long          'Used by PXTblCreate
  260. Dim Field_Type() As Long          'Used by PXTblCreate
  261. Dim Field_Key() As Integer        'Used by PXKeyAdd
  262. '
  263. ' Program variables
  264. '
  265. Dim CRLF As String                'Carriage Return/Line Feed
  266. Dim Copy_Name As String           'Table path & name
  267. Dim Day_ As Integer               'Date day component
  268. Dim Field1_Name As String         'Field 1 name for create
  269. Dim Field1_Type As String         'Field 1 type for create
  270. Dim Field2_Name As String         'Field 2 name for create
  271. Dim Field2_Type As String         'Field 2 type for create
  272. Dim Field3_Name As String         'Field 3 name for create
  273. Dim Field3_Type As String         'Field 3 type for create
  274. Dim Field4_Name As String         'Field 4 name for create
  275. Dim Field4_Type As String         'Field 4 type for create
  276. Dim Field5_Name As String         'Field 5 name for create
  277. Dim Field5_Type As String         'Field 5 type for create
  278. Dim FieldName As String           'Field name
  279. Dim FieldType As String           'Field type
  280. Dim FldHnd As Integer             'Field handle
  281. Dim Line1 As String               'Message box text line 1
  282. Dim Line2 As String               'Message box text line 2
  283. Dim Line3 As String               'Message box text line 3
  284. Dim Line4 As String               'Message box text line 4
  285. Dim Line5 As String               'Message box text line 5
  286. Dim Line6 As String               'Message box text line 6
  287. Dim LockHandle As Integer         'Lock handle
  288. Dim MaxFiles As Integer           'Maximum number of files handles
  289. Dim MaxLocks As Integer           'Maximum locks per table
  290. Dim MaxRecBufs As Integer         'Maximum number of record buffers
  291. Dim MaxTables As Integer          'Maximum number of open tables
  292. Dim Month_ As Integer             'Date month component
  293. Dim Msg As String                 'Message box message
  294. Dim RecHandle1 As Integer         'Record handle
  295. Dim RecHandle2 As Integer         'Record handle
  296. Dim Rename_Name As String         'Table path & name
  297. Dim SortOrder As Integer          'Current sort order
  298. Dim Swapsize As Integer           'Internal swap buffer size
  299. Dim Table_Name As String          'Table path & name
  300. Dim TblHandle As Integer          'Table handle
  301. Dim Title As String               'Message box title
  302. Dim WorkDouble As Double          'Work variable
  303. Dim WorkInteger As Integer        'Work variable
  304. Dim WorkLong As Long              'Work variable
  305. Dim WorkString As String          'Work variable
  306. Dim Year_ As Integer              'Date year component
  307.  
  308. Sub Main ()
  309.     CRLF = Chr$(&HD) + Chr$(&HA)  'Carriage return/Line feed
  310.     Table_Name = "C:\PXEngine"    'Table path & name
  311.     Copy_Name = "C:\Copied"       'Table path & name
  312.     Rename_Name = "C:\Renamed"    'Table path & name
  313.     BLANKALPHA = Space$(0)        'Blank string field
  314.     BLANKSHORT = &H8000           'Blank short integer field
  315.     BLANKLONG = &H80000000        'Blank long integer field
  316.     BLANKDATE = &H80000000        'Blank date field
  317. '
  318.     Title$ = "ErrMsg"
  319.     ErrMsg              'Reports error message
  320.     SetDefaults         'Sets internal default values
  321.     GetDefaults         'Returns internal defalt values
  322.     WinInit             'Initializes Paradox Engine under Windows
  323.     PswAdd              'Enters a password
  324.     TblMaxSize          'Sets maximum size for any table
  325.     TblCreate           'Creates a table
  326.     TblOpen             'Opens a table
  327.     RecBufOpen          'Creates a record transfer buffer
  328.     RecInsert           'Inserts a record into a table
  329.     FldHandle           'Gets the field handle for a given field name
  330.     FldBlank            'Tests if a field is blank
  331.     GetDoub             'Retrieves a double value from a field
  332.     PutDoub             'Assigns a double value to a field
  333.     GetDoub             'Retrieves a double value from a field
  334.     RecUpdate           'Updates the current record in a table
  335.     PutBlank            'Assigns a blank value to a field
  336.     RecAppend           'Appends a record to a table
  337.     RecFirst            'Moves to the first record of a table
  338.     RecNext             'Moves to the next record of a table
  339.     RecPrev             'Moves to the previous record in a table
  340.     RecPrev             'Moves to the previous record in a table
  341.     RecLast             'Moves to last record of a table
  342.     RecPrev             'Moves to the previous record in a table
  343.     RecNext             'Moves to the next record of a table
  344.     RecNext             'Moves to the next record of a table
  345.     RecGoto             'Moves to a specified record
  346.     RecUpdate           'Updates the current record in a table
  347.     RecBufCopy          'Copies source record buffer to destination record buffer
  348.     RecNum              'Finds the current record number
  349.     RecPrev             'Moves to the previous record in a table
  350.     RecNum              'Finds the current record number
  351.     RecNFlds            'Finds the number of fields in a table
  352.     RecGet              'Transfers current record to the record transfer buffer
  353.     RecBufEmpty         'Clears a record transfer buffer
  354.     PutAlpha            'Assigns a string value to a field
  355.     GetAlpha            'Retrieves a string from an alphanumeric field
  356.     PutDate             'Assigns a DATE value to a field
  357.     GetDate             'Retrieves a DATE value from a date field
  358.     PutLong             'Assigns a long integer value to a field
  359.     GetLong             'Retrieves a long value from a field
  360.     PutShort            'Assigns a short integer value to a field
  361.     GetShort            'Retrieves a short integer value from a field
  362.     RecBufClose         'Removes a record transfer buffer
  363.     TblClose            'Closes a table
  364.     KeyAdd              'Creates a primary or secondary index on a table
  365.     KeyDrop             'Deletes primary or secondary index
  366.     TblOpen             'Opens a table
  367.     RecBufOpen          'Creates a record transfer buffer
  368.     DateEncode          'Converts calendar date to internal format
  369.     DateDecode          'Converts internal date to calendar date
  370.     SrchKey             'Searches a table for a key match
  371.     SrchFld             'Searches a table on a specified field
  372.     RecDelete           'Deletes the current record from a table
  373.     TblProtected        'Tests if the table is encrypted
  374.     TblExist            'Tests if a table exists
  375.     TblName             'Finds table name corresponding to table handle
  376.     TblNRecs            'Finds the number of records in a table
  377.     KeyNFlds            'Finds the number of key fields in a table
  378.     FldType             'Gets the field type for a given field handle
  379.     FldName             'Gets the field name for a given field handle
  380.     Save                'Flushes all buffers and writes them to disk
  381.     NetUserName         'Obtains name of user
  382.     NetFileLock         'Locks a file
  383.     NetFileUnlock       'Unlocks a file
  384.     NetTblLock          'Locks a table
  385.     NetTblUnlock        'Unlocks a table
  386.     NetRecLock          'Locks a record
  387.     NetRecLocked        'Determines whether a record has been locked
  388.     NetRecGotoLock      'Returns to a previously locked record
  389.     NetRecUnlock        'Unlocks a record
  390.     NetRecLocked        'Determines whether a record has been locked
  391.     NetTblChanged       'Tests if a table has changed
  392.     NetTblRefresh       'Resynchronizes a table
  393.     NetErrUser          'Reports name of user causing locking error
  394.     RecBufClose         'Removes a record transfer buffer
  395.     TblClose            'Closes a table
  396.     TblEncrypt          'Encrypts a table
  397.     TblProtected        'Tests if the table is encrypted
  398.     TblDecrypt          'Decrypts a table
  399.     TblProtected        'Tests if the table is encrypted
  400.     TblRename           'Changes the base name of a table family
  401.     TblCopy             'Copies one table family to another
  402.     TblCreate           'Creates a table
  403.     TblOpen             'Opens a table
  404.     RecBufOpen          'Creates a record transfer buffer
  405.     TblAdd              'Adds records from one table to another table
  406.     RecBufClose         'Removes a record transfer buffer
  407.     TblClose            'Closes a table
  408.     TblEmpty            'Removes all records from a table
  409.     TblDelete           'Deletes a table and its family
  410.     PswDel              'Removes a password
  411.     Exit_PX             'Closes the Paradox environment
  412. End Sub
  413.  
  414. Sub TblOpen ()
  415.     Title$ = "PXTblOpen"
  416.     RC% = PXTblOpen(Table_Name$, TblHandle%, 0, 0)
  417.     ErrMsg
  418. End Sub
  419.  
  420. Sub TblCreate ()
  421. '
  422. '   Create a Paradox table with one field of each type
  423. '
  424.     Title$ = "PXTblCreate"
  425.     Field1_Name$ = "Numeric"            'Define 1st field name
  426.     Field1_Type$ = "N"                  'Numeric data type
  427.     Field2_Name$ = "Short_number"       'Define 2nd field name
  428.     Field2_Type$ = "S"                  'Short number data type
  429.     Field3_Name$ = "Currency"           'Define 3rd field name
  430.     Field3_Type$ = "$"                  'Currency data type
  431.     Field4_Name$ = "Alphanumeric"       'Define 4th field name
  432.     Field4_Type$ = "A16"                '16 byte alphanumeric data type
  433.     Field5_Name$ = "Date"               'Define 5th field name
  434.     Field5_Type$ = "D"                  'Date data type
  435. '
  436. '   Load field name pointer array
  437. '
  438.     ReDim Field_Name(5) As Long
  439.     Field_Name(0) = AnsiPrev(Field1_Name$, Field1_Name$)
  440.     Field_Name(1) = AnsiPrev(Field2_Name$, Field2_Name$)
  441.     Field_Name(2) = AnsiPrev(Field3_Name$, Field3_Name$)
  442.     Field_Name(3) = AnsiPrev(Field4_Name$, Field4_Name$)
  443.     Field_Name(4) = AnsiPrev(Field5_Name$, Field5_Name$)
  444. '
  445. '   Load field type pointer array
  446. '
  447.     ReDim Field_Type(5) As Long
  448.     Field_Type(0) = AnsiPrev(Field1_Type$, Field1_Type$)
  449.     Field_Type(1) = AnsiPrev(Field2_Type$, Field2_Type$)
  450.     Field_Type(2) = AnsiPrev(Field3_Type$, Field3_Type$)
  451.     Field_Type(3) = AnsiPrev(Field4_Type$, Field4_Type$)
  452.     Field_Type(4) = AnsiPrev(Field5_Type$, Field5_Type$)
  453. '
  454.     RC% = PXTblCreate(Table_Name$, 5, Field_Name(0), Field_Type(0))
  455.     ErrMsg
  456. End Sub
  457.  
  458. Sub ErrMsg ()
  459.     PXMsgPtr& = PXErrMsg(RC%)                   'Message address
  460.     PXMsgLen% = lstrlen(PXMsgPtr&)              'Message length
  461.     PXMsgTxt$ = String$(PXMsgLen% + 1, Chr$(0)) 'Allocate message buffer
  462.     Dummy& = lstrcpy(PXMsgTxt$, PXMsgPtr&)      'Copy message text
  463.     Line1$ = "Paradox Engine return code: " + Str$(RC%) + CRLF$
  464.     Line2$ = PXMsgTxt$
  465.     Msg$ = Line1$ + Line2$
  466.     MsgBox Msg$, 64, Title$ + " function"
  467. End Sub
  468.  
  469. Sub TblClose ()
  470.     Title$ = "PXTblClose"
  471.     RC% = PXTblClose(TblHandle%)
  472.     ErrMsg
  473. End Sub
  474.  
  475. Sub TblEmpty ()
  476.     Title$ = "PXTblEmpty"
  477.     RC% = PXTblEmpty(Table_Name$)
  478.     ErrMsg
  479. End Sub
  480.  
  481. Sub TblDelete ()
  482.     Title$ = "PXTblDelete"
  483.     RC% = PXTblDelete(Table_Name$)
  484.     ErrMsg
  485.     RC% = PXTblDelete(Copy_Name$)
  486.     ErrMsg
  487.     RC% = PXTblDelete(Rename_Name$)
  488.     ErrMsg
  489. End Sub
  490.  
  491. Sub TblRename ()
  492.     Title$ = "PXTblRename"
  493.     RC% = PXTblRename(Table_Name$, Rename_Name$)
  494.     ErrMsg
  495. End Sub
  496.  
  497. Sub TblCopy ()
  498.     Title$ = "PXTblCopy"
  499.     RC% = PXTblCopy(Rename_Name$, Copy_Name$)
  500.     ErrMsg
  501. End Sub
  502.  
  503. Sub TblAdd ()
  504.     Title$ = "PXTblAdd"
  505.     RC% = PXTblAdd(Rename_Name$, Copy_Name$)
  506.     ErrMsg
  507. End Sub
  508.  
  509. Sub SetDefaults ()
  510.     Title$ = "PXSetDefaults"
  511.     SortOrder% = Asc(SortOrderIntl)     'Sort order only under Windows
  512.     RC% = PXSetDefaults(Swapsize%, MaxTables%, MaxRecBufs%, MaxLocks%, MaxFiles%, SortOrder%)
  513.     ErrMsg
  514. End Sub
  515.  
  516. Sub GetDefaults ()
  517.     Title$ = "PXGetDefaults"
  518.     RC% = PXGetDefaults(Swapsize%, MaxTables%, MaxRecBufs%, MaxLocks%, MaxFiles%, SortOrder%)
  519.     ErrMsg
  520.     Line1$ = "Swapsize: " + Str$(Swapsize%) + CRLF
  521.     Line2$ = "MaxTables: " + Str$(MaxTables%) + CRLF
  522.     Line3$ = "MaxRecBufs: " + Str$(MaxRecBufs%) + CRLF
  523.     Line4$ = "MaxLocks: " + Str$(MaxLocks%) + CRLF
  524.     Line5$ = "MaxFiles: " + Str$(MaxFiles%) + CRLF
  525.     Line6$ = "SortOrder:  " + Chr$(SortOrder%)
  526.     Title$ = "Internal Defaults"
  527.     Msg$ = Line1$ + Line2$ + Line3$ + Line4$ + Line5$ + Line6$
  528.     MsgBox Msg$, 0, Title
  529. End Sub
  530.  
  531. Function ISBLANKSHORT (x As Integer) As Integer
  532.     If x = BLANKSHORT Then
  533.         ISBLANKSHORT = 1            'Return Paradox Engine TRUE value
  534.     Else
  535.         ISBLANKSHORT = 0            'Return Paradox Engine FALSE value
  536.     End If
  537. End Function
  538.  
  539. Function ISBLANKLONG (x As Long) As Integer
  540.     If x = BLANKLONG Then
  541.         ISBLANKLONG = 1             'Return Paradox Engine TRUE value
  542.     Else
  543.         ISBLANKLONG = 0             'Return Paradox Engine FALSE value
  544.     End If
  545. End Function
  546.  
  547. Function ISBLANKDATE (x As Long) As Integer
  548.     If x = BLANKDATE Then
  549.         ISBLANKDATE = 1             'Return Paradox Engine TRUE value
  550.     Else
  551.         ISBLANKDATE = 0             'Return Paradox Engine FALSE value
  552.     End If
  553. End Function
  554.  
  555. Function ISBLANKALPHA (x As String) As Integer
  556.     If x = BLANKALPHA Then
  557.         ISBLANKALPHA = 1            'Return Paradox Engine TRUE value
  558.     Else
  559.         ISBLANKALPHA = 0            'Return Paradox Engine FALSE value
  560.     End If
  561. End Function
  562.  
  563. Sub RecBufOpen ()
  564.     Title$ = "PXRecBufOpen"
  565.     RC% = PXRecBufOpen(TblHandle%, RecHandle1%)
  566.     ErrMsg
  567. End Sub
  568.  
  569. Sub FldHandle ()
  570.     Title$ = "PXFldHandle"
  571.     FieldName$ = "Numeric"
  572.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  573.     ErrMsg
  574. End Sub
  575.  
  576. Sub FldBlank ()
  577.     Title$ = "PXFldBlank"
  578.     RC% = PXFldBlank(RecHandle1%, FldHnd%, WorkInteger%)
  579.     ErrMsg
  580.     Msg$ = "Return value: " + Str$(WorkInteger%)
  581.     MsgBox Msg$, 0, "Blank field test"
  582. End Sub
  583.  
  584. Sub GetDoub ()
  585.     Title$ = "PXGetDoub"
  586.     RC% = PXGetDoub(RecHandle1%, FldHnd%, WorkDouble#)
  587.     ErrMsg
  588.     RC% = ISBLANKDOUBLE(WorkDouble#) 'Tests if the argument is blank
  589.     Line1$ = "ISBLANKDOUBLE: " + Str$(RC%) + CRLF
  590.     Line2$ = "Value: " + Str$(WorkDouble#) + CRLF
  591.     Line3$ = "Length: " + Str$(Len(WorkDouble#))
  592.     MsgBox Line1$ + Line2$ + Line3$, 0, "Double field"
  593. End Sub
  594.  
  595. Sub PutDoub ()
  596.     Title$ = "PXPutDoub"
  597.     WorkDouble# = 73150
  598.     RC% = PXPutDoub(RecHandle1%, FldHnd%, WorkDouble#)
  599.     ErrMsg
  600. End Sub
  601.  
  602. Sub WinInit ()
  603.     Title$ = "PXWinInit"
  604.     RC% = PXWinInit("PXEngine", PXSHARED)
  605.     ErrMsg
  606. End Sub
  607.  
  608. Sub RecBufClose ()
  609.     Title$ = "PXRecBufClose"
  610.     RC% = PXRecBufClose(RecHandle1%)
  611.     ErrMsg
  612. End Sub
  613.  
  614. Sub RecBufEmpty ()
  615.     Title$ = "PXRecBufEmpty"
  616.     RC% = PXRecBufEmpty(RecHandle1%)
  617.     ErrMsg
  618. End Sub
  619.  
  620. Sub RecAppend ()
  621.     Title$ = "PXRecAppend"
  622.     RC% = PXRecAppend(TblHandle%, RecHandle1%)
  623.     ErrMsg
  624. End Sub
  625.  
  626. Sub RecInsert ()
  627.     Title$ = "PXRecInsert"
  628.     RC% = PXRecInsert(TblHandle%, RecHandle1%)
  629.     ErrMsg
  630. End Sub
  631.  
  632. Sub RecUpdate ()
  633.     Title$ = "PXRecUpdate"
  634.     RC% = PXRecUpdate(TblHandle%, RecHandle1%)
  635.     ErrMsg
  636. End Sub
  637.  
  638. Sub RecDelete ()
  639.     Title$ = "PXRecDelete"
  640.     RC% = PXRecDelete(TblHandle%)
  641.     ErrMsg
  642. End Sub
  643.  
  644. Sub RecBufCopy ()
  645.     Title$ = "PXRecBufOpen"
  646.     RC% = PXRecBufOpen(TblHandle%, RecHandle2%)
  647.     ErrMsg
  648.     Title$ = "PXRecBufCopy"
  649.     RC% = PXRecBufCopy(RecHandle1%, RecHandle2%)
  650.     ErrMsg
  651.     Title$ = "PXRecBufClose"
  652.     RC% = PXRecBufClose(RecHandle2%)
  653.     ErrMsg
  654. End Sub
  655.  
  656. Sub RecGet ()
  657.     Title$ = "PXRecGet"
  658.     RC% = PXRecGet(TblHandle%, RecHandle1%)
  659.     ErrMsg
  660. End Sub
  661.  
  662. Sub RecFirst ()
  663.     Title$ = "PXRecFirst"
  664.     RC% = PXRecFirst(TblHandle%)
  665.     ErrMsg
  666. End Sub
  667.  
  668. Sub RecLast ()
  669.     Title$ = "PXRecLast"
  670.     RC% = PXRecLast(TblHandle%)
  671.     ErrMsg
  672. End Sub
  673.  
  674. Sub RecNext ()
  675.     Title$ = "PXRecNext"
  676.     RC% = PXRecNext(TblHandle%)
  677.     ErrMsg
  678. End Sub
  679.  
  680. Sub RecPrev ()
  681.     Title$ = "PXRecPrev"
  682.     RC% = PXRecPrev(TblHandle%)
  683.     ErrMsg
  684. End Sub
  685.  
  686. Sub RecGoto ()
  687.     Title$ = "PXRecGoto"
  688.     WorkLong& = 1
  689.     RC% = PXRecGoto(TblHandle%, WorkLong&)
  690.     ErrMsg
  691.     Title$ = "PXRecGoto"
  692.     WorkLong& = 2
  693.     RC% = PXRecGoto(TblHandle%, WorkLong&)
  694.     ErrMsg
  695.     Title$ = "PXRecGoto"
  696.     WorkLong& = 3
  697.     RC% = PXRecGoto(TblHandle%, WorkLong&)
  698.     ErrMsg
  699. End Sub
  700.  
  701. Sub RecNFlds ()
  702.     Title$ = "PXRecNFlds"
  703.     RC% = PXRecNFlds(TblHandle%, WorkInteger%)
  704.     Msg$ = "Field count: " + Str$(WorkInteger%)
  705.     MsgBox Msg$, 0, Title$
  706.     ErrMsg
  707. End Sub
  708.  
  709. Sub RecNum ()
  710.     Title$ = "PXRecNum"
  711.     RC% = PXRecNum(TblHandle%, WorkLong&)
  712.     ErrMsg
  713.     Msg$ = Str$(WorkLong&)
  714.     MsgBox Msg$, 0, "Record number"
  715. End Sub
  716.  
  717. Sub PutShort ()
  718.     Title$ = "PXFldHandle"
  719.     FieldName$ = "Short_number"
  720.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  721.     ErrMsg
  722.     Title$ = "PXPutShort"
  723.     WorkInteger% = 1234
  724.     RC% = PXPutShort(RecHandle1%, FldHnd%, WorkInteger%)
  725.     ErrMsg
  726.     Title$ = "PXFldHandle"
  727.     FieldName$ = "Currency"
  728.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  729.     ErrMsg
  730.     Title$ = "PXPutShort"
  731.     WorkInteger% = 5678
  732.     RC% = PXPutShort(RecHandle1%, FldHnd%, WorkInteger%)
  733.     ErrMsg
  734. End Sub
  735.  
  736. Sub PutLong ()
  737.     Title$ = "PXFldHandle"
  738.     FieldName$ = "Numeric"
  739.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  740.     ErrMsg
  741.     Title$ = "PXPutLong"
  742.     WorkLong& = 73150
  743.     RC% = PXPutLong(RecHandle1%, FldHnd%, WorkLong&)
  744.     ErrMsg
  745. End Sub
  746.  
  747. Sub PutDate ()
  748.     Title$ = "PXFldHandle"
  749.     FieldName$ = "Date"
  750.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  751.     ErrMsg
  752.     Title$ = "PXPutDate"
  753.     WorkLong& = 712069
  754.     RC% = PXPutDate(RecHandle1%, FldHnd%, WorkLong&)
  755.     ErrMsg
  756. End Sub
  757.  
  758. Sub PutAlpha ()
  759.     Title$ = "PXFldHandle"
  760.     FieldName$ = "Alphanumeric"
  761.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  762.     ErrMsg
  763.     Title$ = "PXPutAlpha"
  764.     WorkString$ = "ABCDabcd"
  765.     RC% = PXPutAlpha(RecHandle1%, FldHnd%, WorkString$)
  766.     ErrMsg
  767. End Sub
  768.  
  769. Sub PutBlank ()
  770.     Title$ = "PXPutBlank"
  771.     RC% = PXPutBlank(RecHandle1%, FldHnd%)
  772.     ErrMsg
  773. End Sub
  774.  
  775. Sub GetShort ()
  776.     Title$ = "PXFldHandle"
  777.     FieldName$ = "Short_number"
  778.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  779.     ErrMsg
  780.     Title$ = "PXGetShort"
  781.     RC% = PXGetShort(RecHandle1%, FldHnd%, WorkInteger%)
  782.     ErrMsg
  783.     Line1$ = "Value: " + Str$(WorkInteger%) + CRLF
  784.     Line2$ = "Length: " + Str$(Len(WorkInteger%))
  785.     MsgBox Line1$ + Line2$, 0, "Short integer field"
  786.     Title$ = "PXFldHandle"
  787.     FieldName$ = "Currency"
  788.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  789.     ErrMsg
  790.     Title$ = "PXGetShort"
  791.     RC% = PXGetShort(RecHandle1%, FldHnd%, WorkInteger%)
  792.     ErrMsg
  793.     Line1$ = "Value: " + Str$(WorkInteger%) + CRLF
  794.     Line2$ = "Length: " + Str$(Len(WorkInteger%))
  795.     MsgBox Line1$ + Line2$, 0, "Currency field"
  796. End Sub
  797.  
  798. Sub GetLong ()
  799.     Title$ = "PXFldHandle"
  800.     FieldName$ = "Numeric"
  801.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  802.     ErrMsg
  803.     Title$ = "PXGetLong"
  804.     RC% = PXGetLong(RecHandle1%, FldHnd%, WorkLong&)
  805.     ErrMsg
  806.     Line1$ = "Value: " + Str$(WorkLong&) + CRLF
  807.     Line2$ = "Length: " + Str$(Len(WorkLong&))
  808.     MsgBox Line1$ + Line2$, 0, "Long field"
  809. End Sub
  810.  
  811. Sub GetAlpha ()
  812.     Title$ = "PXFldHandle"
  813.     FieldName$ = "Alphanumeric"
  814.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  815.     ErrMsg
  816.     Title$ = "PXGetAlpha"
  817.     WorkString$ = Space$(13)
  818.     RC% = PXGetAlpha(RecHandle1%, FldHnd%, Len(WorkString$), WorkString$)
  819.     ErrMsg
  820.     Line1$ = "Value: " + WorkString$ + CRLF
  821.     Line2$ = "Length: " + Str$(Len(WorkString$))
  822.     MsgBox Line1$ + Line2$, 0, "Alphanumeric field"
  823. End Sub
  824.  
  825. Sub GetDate ()
  826.     Title$ = "PXFldHandle"
  827.     FieldName$ = "Date"
  828.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  829.     ErrMsg
  830.     Title$ = "PXGetDate"
  831.     RC% = PXGetDate(RecHandle1%, FldHnd%, WorkLong&)
  832.     ErrMsg
  833.     Line1$ = "Value: " + Str$(WorkLong&) + CRLF
  834.     Line2$ = "Length: " + Str$(Len(WorkLong&))
  835.     MsgBox Line1$ + Line2$, 0, "Date field"
  836. End Sub
  837.  
  838. Sub KeyAdd ()
  839.     Title$ = "PXKeyAdd"
  840.     WorkInteger% = 3
  841.     ReDim Field_Key(5) As Integer
  842.     Field_Key%(0) = 1
  843.     Field_Key%(1) = 2
  844.     Field_Key%(2) = 3
  845.     Field_Key%(3) = 4
  846.     Field_Key%(4) = 5
  847.     RC% = PXKeyAdd(Table_Name$, WorkInteger%, Field_Key%(0), PRIMARY)
  848.     ErrMsg
  849.     WorkInteger% = 1
  850.     RC% = PXKeyAdd(Table_Name$, WorkInteger%, Field_Key%(3), SECONDARY)
  851.     ErrMsg
  852.     WorkInteger% = 1
  853.     RC% = PXKeyAdd(Table_Name$, WorkInteger%, Field_Key%(4), INCSECONDARY)
  854.     ErrMsg
  855. End Sub
  856.  
  857. Sub KeyDrop ()
  858.     Title$ = "PXKeyDrop"
  859.     WorkInteger% = 5
  860.     RC% = PXKeyDrop(Table_Name$, WorkInteger%)
  861.     ErrMsg
  862.     WorkInteger% = 4
  863.     RC% = PXKeyDrop(Table_Name$, WorkInteger%)
  864.     ErrMsg
  865.     WorkInteger% = 0
  866.     RC% = PXKeyDrop(Table_Name$, WorkInteger%)
  867.     ErrMsg
  868. End Sub
  869.  
  870. Sub DateEncode ()
  871.     Title$ = "PXDateEncode"
  872.     Month_% = 7
  873.     Day_% = 31
  874.     Year_% = 1950
  875.     RC% = PXDateEncode(Month_%, Day_%, Year_%, WorkLong&)
  876.     ErrMsg
  877.     Msg$ = "PXdate: " + Str$(WorkLong&)
  878.     MsgBox Msg$, 0, "Encoded date"
  879. End Sub
  880.  
  881. Sub DateDecode ()
  882.     Title$ = "PXDateDecode"
  883.     WorkLong& = 712069                          'Paradox date format
  884.     RC% = PXDateDecode(WorkLong&, Month_%, Day_%, Year_%)
  885.     ErrMsg
  886.     Line1$ = "Month: " + Str$(Month_%) + CRLF
  887.     Line2$ = "Day: " + Str$(Day_%) + CRLF
  888.     Line3$ = "Year: " + Str$(Year_%)
  889.     Msg$ = Line1$ + Line2$ + Line3$
  890.     MsgBox Msg$, 0, "Decoded date"
  891. End Sub
  892.  
  893. Sub SrchKey ()
  894.     Title$ = "PXFldHandle"
  895.     FieldName$ = "Numeric"
  896.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  897.     ErrMsg
  898.     Title$ = "PXPutDoub"
  899.     WorkDouble# = 73150
  900.     RC% = PXPutDoub(RecHandle1%, FldHnd%, WorkDouble#)
  901.     ErrMsg
  902.     Title$ = "PXSrchKey"
  903.     WorkInteger% = 1
  904.     RC% = PXSrchKey(TblHandle%, RecHandle1%, WorkInteger%, SEARCHFIRST)
  905.     ErrMsg
  906. End Sub
  907.  
  908. Sub SrchFld ()
  909.     Title$ = "PXFldHandle"
  910.     FieldName$ = "Numeric"
  911.     RC% = PXFldHandle(TblHandle%, FieldName$, FldHnd%)
  912.     ErrMsg
  913.     Title$ = "PXPutDoub"
  914.     WorkDouble# = 73150
  915.     RC% = PXPutDoub(RecHandle1%, FldHnd%, WorkDouble#)
  916.     ErrMsg
  917.     Title$ = "PXSrchFld"
  918.     RC% = PXSrchFld(TblHandle%, RecHandle1%, FldHnd%, SEARCHFIRST)
  919.     ErrMsg
  920. End Sub
  921.  
  922. Sub TblProtected ()
  923.     Title$ = "PXTblProtected"
  924.     RC% = PXTblProtected(Table_Name$, WorkInteger%)
  925.     ErrMsg
  926.     Msg$ = "Return value: " + Str$(WorkInteger%)
  927.     MsgBox Msg$, 0, "Protect Mode"
  928. End Sub
  929.  
  930. Sub PswAdd ()
  931.     Title$ = "PXPswAdd"
  932.     WorkString$ = "Password"
  933.     RC% = PXPswAdd(WorkString$)
  934.     ErrMsg
  935. End Sub
  936.  
  937. Sub PswDel ()
  938.     Title$ = "PXPswDel"
  939.     WorkString$ = "Password"
  940.     RC% = PXPswDel(WorkString$)
  941.     ErrMsg
  942. End Sub
  943.  
  944. Sub TblEncrypt ()
  945.     Title$ = "PXTblEncrypt"
  946.     WorkString$ = "Password"
  947.     RC% = PXTblEncrypt(Table_Name$, WorkString$)
  948.     ErrMsg
  949. End Sub
  950.  
  951. Sub TblDecrypt ()
  952.     Title$ = "PXTblDecrypt"
  953.     RC% = PXTblDecrypt(Table_Name$)
  954.     ErrMsg
  955. End Sub
  956.  
  957. Sub TblExist ()
  958.     Title$ = "PXTblExist"
  959.     RC% = PXTblExist(Table_Name$, WorkInteger%)
  960.     ErrMsg
  961.     Msg$ = "Return value: " + Str$(WorkInteger%)
  962.     MsgBox Msg$, 0, "Table exists?"
  963. End Sub
  964.  
  965. Sub TblName ()
  966.     Title$ = "PXTblName"
  967.     WorkString$ = Space$(16)
  968.     RC% = PXTblName(TblHandle%, Len(WorkString$), WorkString$)
  969.     ErrMsg
  970.     Msg$ = WorkString$
  971.     MsgBox Msg$, 0, "Table Name"
  972. End Sub
  973.  
  974. Sub TblNRecs ()
  975.     Title$ = "PXTblNRecs"
  976.     RC% = PXTblNRecs(TblHandle%, WorkLong&)
  977.     ErrMsg
  978.     Msg$ = Str$(WorkLong&)
  979.     MsgBox Msg$, 0, "Record Count"
  980. End Sub
  981.  
  982. Sub KeyNFlds ()
  983.     Title$ = "PXKeyNFlds"
  984.     RC% = PXKeyNFlds(TblHandle%, WorkInteger%)
  985.     ErrMsg
  986.     Msg$ = Str$(WorkInteger%)
  987.     MsgBox Msg$, 0, "Key Field Count"
  988. End Sub
  989.  
  990. Sub FldType ()
  991.     Title$ = "PXFldType"
  992.     FieldType$ = Space$(6)
  993.     RC% = PXFldType(TblHandle%, FldHnd%, Len(FieldType$), FieldType$)
  994.     ErrMsg
  995.     Msg$ = FieldType$
  996.     MsgBox Msg$, 0, "Field Type"
  997. End Sub
  998.  
  999. Sub FldName ()
  1000.     Title$ = "PXFldName"
  1001.     FieldName$ = Space$(26)
  1002.     RC% = PXFldName(TblHandle%, FldHnd%, Len(FieldName$), FieldName$)
  1003.     ErrMsg
  1004.     Msg$ = FieldName$
  1005.     MsgBox Msg$, 0, "Field Name"
  1006. End Sub
  1007.  
  1008. Sub TblMaxSize ()
  1009.     Title$ = "PXTblMaxSize"
  1010.     WorkInteger% = 64
  1011.     RC% = PXTblMaxSize(WorkInteger%)
  1012.     ErrMsg
  1013. End Sub
  1014.  
  1015. Sub Save ()
  1016.     Title$ = "PXSave"
  1017.     RC% = PXSave()
  1018.     ErrMsg
  1019. End Sub
  1020.  
  1021. Sub NetUserName ()
  1022.     Title$ = "PXNetUserName"
  1023.     WorkString$ = Space$(33)
  1024.     RC% = PXNetUserName(Len(WorkString$), WorkString$)
  1025.     ErrMsg
  1026.     Msg$ = WorkString$
  1027.     MsgBox Msg$, 0, "User Name"
  1028. End Sub
  1029.  
  1030. Sub NetFileLock ()
  1031.     Title$ = "PXNetFileLock"
  1032.     RC% = PXNetFileLock(Table_Name$, FL%)
  1033.     ErrMsg
  1034. End Sub
  1035.  
  1036. Sub NetFileUnlock ()
  1037.     Title$ = "PXNetFileUnlock"
  1038.     RC% = PXNetFileUnlock(Table_Name$, FL%)
  1039.     ErrMsg
  1040. End Sub
  1041.  
  1042. Sub NetTblLock ()
  1043.     Title$ = "PXNetTblLock"
  1044.     RC% = PXNetTblLock(TblHandle%, FL%)
  1045.     ErrMsg
  1046. End Sub
  1047.  
  1048. Sub NetTblUnlock ()
  1049.     Title$ = "PXNetTblUnlock"
  1050.     RC% = PXNetTblUnlock(TblHandle%, FL%)
  1051.     ErrMsg
  1052. End Sub
  1053.  
  1054. Sub NetRecLock ()
  1055.     Title$ = "PXNetRecLock"
  1056.     RC% = PXNetRecLock(TblHandle%, LockHandle%)
  1057.     ErrMsg
  1058. End Sub
  1059.  
  1060. Sub NetRecUnlock ()
  1061.     Title$ = "PXNetRecUnlock"
  1062.     RC% = PXNetRecUnlock(TblHandle%, LockHandle%)
  1063.     ErrMsg
  1064. End Sub
  1065.  
  1066. Sub NetRecLocked ()
  1067.     Title$ = "PXNetRecLocked"
  1068.     RC% = PXNetRecLocked(TblHandle%, WorkInteger%)
  1069.     ErrMsg
  1070.     Msg$ = "Return value: " + Str$(WorkInteger%)
  1071.     MsgBox Msg$, 0, "Record Lock Status"
  1072. End Sub
  1073.  
  1074. Sub NetRecGotoLock ()
  1075.     Title$ = "PXNetRecGotoLock"
  1076.     RC% = PXNetRecGotoLock(TblHandle%, LockHandle%)
  1077.     ErrMsg
  1078. End Sub
  1079.  
  1080. Sub NetTblChanged ()
  1081.     Title$ = "PXNetTblChanged"
  1082.     RC% = PXNetTblChanged(TblHandle%, WorkInteger%)
  1083.     ErrMsg
  1084.     Msg$ = "Return value: " + Str$(WorkInteger%)
  1085.     MsgBox Msg$, 0, "Table Change Status"
  1086. End Sub
  1087.  
  1088. Sub NetTblRefresh ()
  1089.     Title$ = "PXNetTblRefresh"
  1090.     RC% = PXNetTblRefresh(TblHandle%)
  1091.     ErrMsg
  1092. End Sub
  1093.  
  1094. Sub NetErrUser ()
  1095.     Title$ = "PXNetErrUser"
  1096.     WorkString$ = Space$(33)
  1097.     RC% = PXNetErrUser(Len(WorkString$), WorkString$)
  1098.     ErrMsg
  1099.     Msg$ = WorkString$
  1100.     MsgBox Msg$, 0, "Locking Error User Name"
  1101. End Sub
  1102.  
  1103. Sub Exit_PX ()
  1104.     Title$ = "PXExit"
  1105.     RC% = PXExit()
  1106.     ErrMsg
  1107. End Sub
  1108.  
  1109.