home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / codebsic / codebase.bas < prev    next >
BASIC Source File  |  1995-02-01  |  37KB  |  899 lines

  1. ' Data Types Used by CodeBasic
  2.  
  3. Type FIELD4INFOCB
  4.     fname As Long        ' C string (which is different than a Basic String)
  5.     ftype As Integer
  6.     flength As Integer
  7.     fdecimals As Integer
  8. End Type
  9.  
  10. Type FIELD4INFO          ' Corresponding Basic structure
  11.     fname As String
  12.     ftype As String * 1
  13.     flength As Integer
  14.     fdecimals As Integer
  15. End Type
  16.  
  17. Type TAG4INFOCB
  18.     name As Long         ' C string
  19.     expression As Long   ' C string
  20.     filter As Long       ' C string
  21.     unique As Integer
  22.     descending As Integer
  23. End Type
  24.  
  25. Type TAG4INFO
  26.     name As String
  27.     expression As String
  28.     filter As String
  29.     unique As Integer
  30.     descending As Integer
  31. End Type
  32.  
  33.  
  34. '===================================================================================
  35. '
  36. '     CODE4 Access  function prototypes
  37. '
  38. '===================================================================================
  39.  
  40. Declare Function code4autoOpen% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  41. Declare Function code4createError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  42. Declare Function code4dateFormatCB& Lib "cb5demo.dll" Alias "code4dateFormat" (ByVal c4&, ByVal pic$)
  43. Declare Function code4defaultUniqueError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  44. Declare Function code4errorCode% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  45. Declare Function code4exclusive% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  46. Declare Function code4exprError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  47. Declare Function code4fieldNameError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  48. Declare Function code4fileFlush% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  49. Declare Function code4goError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  50. Declare Function code4hWnd% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  51. Declare Function code4lockAttempts% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  52. Declare Function code4memExpandBlock% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  53. Declare Function code4memExpandData% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  54. Declare Function code4memExpandIndex% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  55. Declare Function code4memExpandTag% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  56. Declare Function code4memSizeBlock& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  57. Declare Function code4memSizeBuffer& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  58. Declare Function code4memSizeMemo% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  59. Declare Function code4memSizeMemoExpr& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  60. Declare Function code4memSizeSortBuffer& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  61. Declare Function code4memSizeSortPool& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  62. Declare Function code4memStartBlock% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  63. Declare Function code4memStartData% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  64. Declare Function code4memStartIndex% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  65. Declare Function code4memStartMax& Lib "cb5demo.dll" (ByVal c4&, ByVal value&)
  66. Declare Function code4memStartTag% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  67. Declare Function code4offError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  68. Declare Function code4openError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  69. Declare Function code4optimize% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  70. Declare Function code4optimizeWrite% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  71. Declare Function code4readLock% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  72. Declare Function code4readOnly% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  73. Declare Function code4relateError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  74. Declare Function code4safety% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  75. Declare Function code4skipError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  76. Declare Function code4tagNameError% Lib "cb5demo.dll" (ByVal c4&, ByVal value%)
  77.  
  78. '===============================================================================================
  79. '
  80. '                                 CodeControls function prototypes
  81. '
  82. '-----------------------------------------------------------------------------------------------
  83.  
  84. Declare Function ctrl4init Lib "cc2.vbx" Alias "ctrl4initVB" () As Long
  85. Declare Function ctrl4initUndo Lib "cc2.vbx" Alias "ctrl4initUndoVB" (ByVal code As Long) As Integer
  86.  
  87. '===============================================================================================
  88. '
  89. '                                 Data File Functions' Prototypes
  90. '
  91. '-----------------------------------------------------------------------------------------------
  92. Declare Function d4aliasCB& Lib "cb5demo.dll" Alias "d4alias" (ByVal d4&)
  93. Declare Sub d4aliasSet Lib "cb5demo.dll" Alias "d4alias_set" (ByVal d4&, ByVal AliasValue$)
  94. Declare Function d4append% Lib "cb5demo.dll" (ByVal d4&)
  95. Declare Function d4appendblank% Lib "cb5demo.dll" Alias "d4append_blank" (ByVal d4&)
  96. Declare Function d4appendStart% Lib "cb5demo.dll" Alias "d4append_start" (ByVal d4&, ByVal UseMemoEntries%)
  97. Declare Sub d4blank Lib "cb5demo.dll" (ByVal d4&)
  98. Declare Function d4bof% Lib "cb5demo.dll" (ByVal d4&)
  99. Declare Function d4bottom% Lib "cb5demo.dll" (ByVal d4&)
  100. Declare Function d4changed% Lib "cb5demo.dll" (ByVal d4&, ByVal intFlag%)
  101. Declare Function d4check% Lib "cb5demo.dll" (ByVal d4&)
  102. Declare Function d4close% Lib "cb5demo.dll" (ByVal d4&)
  103. Declare Function d4closeAll% Lib "cb5demo.dll" Alias "d4close_all" (ByVal c4&)
  104. Declare Function d4createCB& Lib "cb5demo.dll" Alias "d4create" (ByVal c4&, ByVal DbfName$, fieldinfo As Any, tagInfo As Any)
  105. Declare Function d4data& Lib "cb5demo.dll" (ByVal c4&, ByVal AliasName$)
  106. Declare Sub d4delete Lib "cb5demo.dll" (ByVal d4&)
  107. Declare Function d4deleted% Lib "cb5demo.dll" (ByVal d4&)
  108. Declare Function d4eof% Lib "cb5demo.dll" (ByVal d4&)
  109. Declare Function d4field& Lib "cb5demo.dll" (ByVal d4&, ByVal FieldName$)
  110. Declare Function d4fieldInfo& Lib "cb5demo.dll" Alias "d4field_info" (ByVal d4&)
  111. Declare Function d4fieldJ& Lib "cb5demo.dll" Alias "d4field_j" (ByVal d4&, ByVal JField%)
  112. Declare Function d4fieldNumber% Lib "cb5demo.dll" Alias "d4field_number" (ByVal d4&, ByVal FieldName$)
  113. Declare Function d4fileNameCB& Lib "cb5demo.dll" Alias "d4fileName" (ByVal d4&)
  114. Declare Function d4flush% Lib "cb5demo.dll" (ByVal d4&)
  115. Declare Function d4flushData% Lib "cb5demo.dll" Alias "d4flush_data" (ByVal d4&)
  116. Declare Function d4flushFiles% Lib "cb5demo.dll" Alias "d4flush_files" (ByVal c4&)
  117. Declare Function d4freeBlocks% Lib "cb5demo.dll" Alias "d4free_blocks" (ByVal d4&)
  118. Declare Function d4go% Lib "cb5demo.dll" (ByVal d4&, ByVal RecNum&)
  119. Declare Function d4goData% Lib "cb5demo.dll" Alias "d4go_data" (ByVal d4&, ByVal RecNum&)
  120. Declare Function d4goEof% Lib "cb5demo.dll" Alias "d4go_eof" (ByVal d4&)
  121. Declare Function d4index& Lib "cb5demo.dll" (ByVal d4&, ByVal IndexName$)
  122. Declare Function d4init& Lib "cb5demo.dll" Alias "d4init_v" ()
  123. Declare Function d4initUndo% Lib "cb5demo.dll" (ByVal c4&)
  124. Declare Function d4lock% Lib "cb5demo.dll" (ByVal d4&, ByVal RecordNum&)
  125. Declare Function d4lockAll% Lib "cb5demo.dll" Alias "d4lock_all" (ByVal d4&)
  126. Declare Function d4lockAppend% Lib "cb5demo.dll" Alias "d4lock_append" (ByVal d4&)
  127. Declare Function d4lockFile% Lib "cb5demo.dll" Alias "d4lock_file" (ByVal d4&)
  128. Declare Function d4lockGroup% Lib "cb5demo.dll" Alias "d4lock_group" (ByVal d4&, RecordsArray&, ByVal NumRecords%)
  129. Declare Function d4lockIndex% Lib "cb5demo.dll" Alias "d4lock_index" (ByVal d4&)
  130. Declare Function d4lockTest% Lib "cb5demo.dll" Alias "d4lock_test" (ByVal d4&, ByVal RecNum&)
  131. Declare Function d4lockTestAppend% Lib "cb5demo.dll" Alias "d4lock_test_append" (ByVal d4&)
  132. Declare Function d4lockTestFile% Lib "cb5demo.dll" Alias "d4lock_test_file" (ByVal d4&)
  133. Declare Function d4lockTestIndex% Lib "cb5demo.dll" Alias "d4lock_test_index" (ByVal d4&)
  134. Declare Function d4memoCompress% Lib "cb5demo.dll" Alias "d4memo_compress" (ByVal d4&)
  135. Declare Function d4numFields% Lib "cb5demo.dll" Alias "d4num_fields" (ByVal d4&)
  136. Declare Function d4open& Lib "cb5demo.dll" (ByVal c4&, ByVal DbfName$)
  137. Declare Function d4optStart% Lib "cb5demo.dll" Alias "d4opt_start" (ByVal c4&)
  138. Declare Function d4optSuspend% Lib "cb5demo.dll" Alias "d4opt_suspend" (ByVal c4&)
  139. Declare Function d4optimize% Lib "cb5demo.dll" (ByVal d4&, ByVal OptFlag%)
  140. Declare Function d4optimizeWrite% Lib "cb5demo.dll" Alias "d4optimize_write" (ByVal d4&, ByVal OptFlag%)
  141. Declare Function d4pack% Lib "cb5demo.dll" (ByVal d4&)
  142. Declare Function d4packData% Lib "cb5demo.dll" Alias "d4pack_data" (ByVal d4&)
  143. Declare Function d4position# Lib "cb5demo.dll" (ByVal d4&)
  144. Declare Function d4positionSet% Lib "cb5demo.dll" Alias "d4position_set" (ByVal d4&, ByVal Percentage#)
  145. Declare Sub d4recall Lib "cb5demo.dll" (ByVal d4&)
  146. Declare Function d4reccount& Lib "cb5demo.dll" (ByVal d4&)
  147. Declare Function d4recno& Lib "cb5demo.dll" (ByVal d4&)
  148. Declare Function d4record& Lib "cb5demo.dll" (ByVal d4&)
  149. Declare Function d4recordWidth& Lib "cb5demo.dll" Alias "d4record_width" (ByVal d4&)
  150. Declare Function d4refresh% Lib "cb5demo.dll" (ByVal d4&)
  151. Declare Function d4refreshRecord% Lib "cb5demo.dll" Alias "d4refresh_record" (ByVal d4&)
  152. Declare Function d4reindex% Lib "cb5demo.dll" (ByVal d4&)
  153. Declare Function d4seek% Lib "cb5demo.dll" (ByVal d4&, ByVal seekValue$)
  154. Declare Function d4seekDouble% Lib "cb5demo.dll" Alias "d4seek_double" (ByVal d4&, ByVal value#)
  155. Declare Function d4skip% Lib "cb5demo.dll" (ByVal d4&, ByVal NumberRecords&)
  156. Declare Function d4tag& Lib "cb5demo.dll" (ByVal d4&, ByVal TagName$)
  157. Declare Function d4tagDefault& Lib "cb5demo.dll" Alias "d4tag_default" (ByVal d4&)
  158. Declare Function d4tagNext& Lib "cb5demo.dll" Alias "d4tag_next" (ByVal d4&, ByVal TagOn As Any)
  159. Declare Function d4tagPrev& Lib "cb5demo.dll" Alias "d4tag_prev" (ByVal d4&, ByVal TagOn As Any)
  160. Declare Sub d4tagSelect Lib "cb5demo.dll" Alias "d4tag_select" (ByVal d4&, ByVal tPtr As Any)
  161. Declare Function d4tagSelected& Lib "cb5demo.dll" Alias "d4tag_selected" (ByVal d4&)
  162. Declare Function d4top% Lib "cb5demo.dll" (ByVal d4&)
  163. Declare Function d4unlock% Lib "cb5demo.dll" (ByVal d4&)
  164. Declare Function d4unlockFiles% Lib "cb5demo.dll" Alias "d4unlock_files" (ByVal d4&)
  165. Declare Function d4write% Lib "cb5demo.dll" (ByVal d4&, ByVal RecNum&)
  166. Declare Function d4zap% Lib "cb5demo.dll" (ByVal d4&, ByVal StartRecord&, ByVal EndRecord&)
  167.  
  168. '===============================================================================================
  169. '
  170. '                                   Date Functions' Prototypes
  171. '
  172. '-----------------------------------------------------------------------------------------------
  173. Declare Sub date4assign Lib "cb5demo.dll" (ByVal DateForm$, ByVal JulianDay&)
  174. Declare Function date4cdowCB& Lib "cb5demo.dll" Alias "date4cdow" (ByVal DateForm$)
  175. Declare Function date4cmonthCB& Lib "cb5demo.dll" Alias "date4cmonth" (ByVal DateForm$)
  176. Declare Function date4day% Lib "cb5demo.dll" (ByVal DateForm$)
  177. Declare Function date4dow% Lib "cb5demo.dll" (ByVal DateForm$)
  178. Declare Sub date4formatCB Lib "cb5demo.dll" Alias "date4format" (ByVal DateForm$, ByVal Result$, ByVal pic$)
  179. Declare Sub date4initCB Lib "cb5demo.dll" Alias "date4init" (ByVal DateForm$, ByVal value$, ByVal pic$)
  180. Declare Function date4long& Lib "cb5demo.dll" (ByVal DateForm$)
  181. Declare Function date4month% Lib "cb5demo.dll" (ByVal DateForm$)
  182. Declare Sub date4timeNow Lib "cb5demo.dll" Alias "date4time_now" (ByVal TimeForm$)
  183. Declare Sub date4todayCB Lib "cb5demo.dll" Alias "date4today" (ByVal DateForm$)
  184. Declare Function date4year% Lib "cb5demo.dll" (ByVal DateForm$)
  185.  
  186.  
  187. '===============================================================================================
  188. '
  189. '                          Expression Evaluation Functions' Prototypes
  190. '
  191. '-----------------------------------------------------------------------------------------------
  192. Declare Function expr4double# Lib "cb5demo.dll" (ByVal ExprPtr&)
  193. Declare Sub expr4free Lib "cb5demo.dll" (ByVal ExprPtr&)
  194. Declare Function expr4Len% Lib "cb5demo.dll" (ByVal ExprPtr&)
  195. Declare Function expr4parse& Lib "cb5demo.dll" (ByVal d4&, ByVal expression$)
  196. Declare Function expr4true% Lib "cb5demo.dll" (ByVal ExprPtr&)
  197. Declare Function expr4type% Lib "cb5demo.dll" (ByVal ExprPtr&)
  198.  
  199. '===============================================================================================
  200. '
  201. '                            Field Functions' Prototypes
  202. '
  203. '-----------------------------------------------------------------------------------------------
  204. Declare Sub f4assign Lib "cb5demo.dll" (ByVal fPtr&, ByVal value$)
  205. Declare Sub f4assignChar Lib "cb5demo.dll" Alias "f4assign_char" (ByVal fPtr&, ByVal Char%)
  206. Declare Sub f4assignDouble Lib "cb5demo.dll" Alias "f4assign_double" (ByVal fPtr&, ByVal value#)
  207. Declare Sub f4assignField Lib "cb5demo.dll" Alias "f4assign_field" (ByVal fPtrTo&, ByVal fPtrFrom&)
  208. Declare Sub f4assignInt Lib "cb5demo.dll" Alias "f4assign_int" (ByVal fPtr&, ByVal value%)
  209. Declare Sub f4assignLong Lib "cb5demo.dll" Alias "f4assign_long" (ByVal fPtr&, ByVal value&)
  210. Declare Sub f4assignN Lib "cb5demo.dll" Alias "f4assign_n" (ByVal fPtr&, ByVal value$, ByVal Length%)
  211. Declare Sub f4blank Lib "cb5demo.dll" (ByVal fPtr&)
  212. Declare Function f4char% Lib "cb5demo.dll" (ByVal fPtr&)
  213. Declare Function f4data& Lib "cb5demo.dll" (ByVal fPtr&)
  214. Declare Function f4decimals% Lib "cb5demo.dll" (ByVal fPtr&)
  215. Declare Function f4double# Lib "cb5demo.dll" (ByVal fPtr&)
  216. Declare Function f4int% Lib "cb5demo.dll" (ByVal fPtr&)
  217. Declare Function f4len% Lib "cb5demo.dll" Alias "f4len_v" (ByVal fPtr&)
  218. Declare Function f4long& Lib "cb5demo.dll" (ByVal fPtr&)
  219. Declare Function f4memoAssign% Lib "cb5demo.dll" Alias "f4memo_assign" (ByVal fPtr&, ByVal value$)
  220. Declare Function f4memoAssignN% Lib "cb5demo.dll" Alias "f4memo_assign_n" (ByVal fPtr&, ByVal value$, ByVal Length%)
  221. Declare Sub f4memoFree Lib "cb5demo.dll" Alias "f4memo_free" (ByVal fPtr&)
  222. Declare Function f4memoLen& Lib "cb5demo.dll" (ByVal fPtr&)
  223. Declare Function f4memoNcpy% Lib "cb5demo.dll" Alias "f4memo_ncpy" (ByVal fPtr&, ByVal memPtr$, ByVal memLen%)
  224. Declare Function f4memoPtr& Lib "cb5demo.dll" Alias "f4memo_ptr" (ByVal fPtr&)
  225. Declare Function f4memoStrCB& Lib "cb5demo.dll" Alias "f4memo_str" (ByVal fPtr&)
  226. Declare Function f4nameCB& Lib "cb5demo.dll" Alias "f4name" (ByVal fPtr&)
  227. Declare Function f4ncpy% Lib "cb5demo.dll" (ByVal fPtr&, ByVal memPtr$, ByVal memLength%)
  228. Declare Function f4ptr& Lib "cb5demo.dll" (ByVal fPtr&)
  229. Declare Function f4strCB& Lib "cb5demo.dll" Alias "f4str" (ByVal fPtr&)
  230. Declare Function f4true% Lib "cb5demo.dll" (ByVal fPtr&)
  231. Declare Function f4type% Lib "cb5demo.dll" (ByVal fPtr&)
  232.  
  233. '===============================================================================================
  234. '
  235. '                             Index Functions' Prototypes
  236. '
  237. '-----------------------------------------------------------------------------------------------
  238. Declare Function i4close% Lib "cb5demo.dll" (ByVal i4&)
  239. Declare Function i4createCB& Lib "cb5demo.dll" Alias "i4create" (ByVal d4&, ByVal fileName As Any, tagInfo As TAG4INFOCB)
  240. Declare Function i4lock% Lib "cb5demo.dll" (ByVal i4&)
  241. Declare Function i4openCB& Lib "cb5demo.dll" Alias "i4open" (ByVal d4&, ByVal fileName As Any)
  242. Declare Function i4reindex% Lib "cb5demo.dll" (ByVal i4&)
  243. Declare Function i4tag& Lib "cb5demo.dll" (ByVal i4&, ByVal fileName$)
  244. Declare Function i4tagInfo& Lib "cb5demo.dll" Alias "i4tag_info" (ByVal i4&)
  245. Declare Function i4unlock% Lib "cb5demo.dll" (ByVal i4&)
  246.  
  247. '===============================================================================================
  248. '
  249. '                            Relate Functions' Prototypes
  250. '
  251. '-----------------------------------------------------------------------------------------------
  252.  
  253. Declare Function relate4bottom% Lib "cb5demo.dll" (ByVal r4&)
  254. Declare Sub relate4changed Lib "cb5demo.dll" (ByVal r4&)
  255. Declare Function relate4createSlave& Lib "cb5demo.dll" Alias "relate4create_slave" (ByVal r4&, ByVal d4&, ByVal mExpr$, ByVal t4 As Any)
  256. Declare Function relate4data& Lib "cb5demo.dll" (ByVal r4&)
  257. Declare Function relate4dataTag& Lib "cb5demo.dll" (ByVal r4&)
  258. Declare Function relate4do% Lib "cb5demo.dll" (ByVal r4&)
  259. Declare Function relate4doOne% Lib "cb5demo.dll" Alias "relate4do_one" (ByVal r4&)
  260. Declare Function relate4errorAction% Lib "cb5demo.dll" Alias "relate4error_action" (ByVal r4&, ByVal ErrAction%)
  261. Declare Function relate4free% Lib "cb5demo.dll" (ByVal r4&, ByVal CloseFlag%)
  262. Declare Function relate4init& Lib "cb5demo.dll" (ByVal d4&)
  263. Declare Function relate4lock% Lib "cb5demo.dll" (ByVal r4&)
  264. Declare Function relate4matchLen% Lib "cb5demo.dll" Alias "relate4match_len" (ByVal r4&, ByVal Length%)
  265. Declare Function relate4master& Lib "cb5demo.dll" (ByVal r4&)
  266. Declare Function relate4next% Lib "cb5demo.dll" (r4&)
  267. Declare Function relate4querySet% Lib "cb5demo.dll" Alias "relate4query_set" (ByVal r4&, ByVal expr As String)
  268. Declare Function relate4retrieve& Lib "cb5demo.dll" (ByVal c4&, ByVal fileName$, ByVal openFiles%, ByVal dataPathName$)
  269. Declare Function relate4save% Lib "cb5demo.dll" (ByVal rel4&, ByVal fileName$, ByVal savePathNames%)
  270. Declare Function relate4skip% Lib "cb5demo.dll" (ByVal r4&, ByVal NumRecs&)
  271. Declare Function relate4skipEnable% Lib "cb5demo.dll" Alias "relate4skip_enable" (ByVal r4&, ByVal DoEnable%)
  272. Declare Function relate4sortSet% Lib "cb5demo.dll" Alias "relate4sort_set" (ByVal r4&, ByVal expr As String)
  273. Declare Function relate4top% Lib "cb5demo.dll" (ByVal r4&)
  274. Declare Function relate4topMaster& Lib "cb5demo.dll" (ByVal r4&)
  275. Declare Function relate4type% Lib "cb5demo.dll" (ByVal r4&, ByVal rType%)
  276. Declare Function relate4unlock% Lib "cb5demo.dll" (ByVal r4&)
  277.  
  278. '===============================================================================================
  279. '
  280. '  Report function prototypes
  281. '
  282. '================================================================================================
  283.  
  284. Declare Function report4caption% Lib "cb5demo.dll" (ByVal r4&, ByVal caption$)
  285. Declare Function report4currency% Lib "cb5demo.dll" (ByVal r4&, ByVal currncy$)
  286. Declare Function report4dateFormat% Lib "cb5demo.dll" (ByVal r4&, ByVal dateFmt$)
  287. Declare Function report4decimal% Lib "cb5demo.dll" Alias "report4decimal_v" (ByVal r4&, ByVal decChar$)
  288. Declare Function report4do% Lib "cb5demo.dll" Alias "report4do_v" (ByVal r4&)
  289. Declare Sub report4free Lib "cb5demo.dll" (ByVal r4&, ByVal freeRelate%, ByVal closeFiles%)
  290. Declare Function report4margins% Lib "cb5demo.dll" (ByVal r4&, ByVal mLeft&, ByVal mRight&, ByVal mTop&, ByVal mBottom&, ByVal uType%)
  291. Declare Function report4pageSize% Lib "cb5demo.dll" (ByVal r4&, ByVal pHeight&, ByVal pWidth&, ByVal uType%)
  292. Declare Function report4parent% Lib "cb5demo.dll" (ByVal r4&, ByVal hWnd%)
  293. Declare Sub report4printerSelect Lib "cb5demo.dll" (ByVal r4&)
  294. Declare Function report4querySet% Lib "cb5demo.dll" (ByVal r4&, ByVal queryExpr$)
  295. Declare Function report4relate& Lib "cb5demo.dll" (ByVal r4&)
  296. Declare Function report4retrieve& Lib "cb5demo.dll" (ByVal c4&, ByVal fileName$, ByVal openFiles%, ByVal dataPath$)
  297. Declare Function report4save% Lib "cb5demo.dll" (ByVal r4&, ByVal fileName$, ByVal savePaths%)
  298. Declare Function report4separator% Lib "cb5demo.dll" Alias "report4separator_v" (ByVal r4&, ByVal separator$)
  299. Declare Function report4sortSet% Lib "cb5demo.dll" (ByVal r4&, ByVal sortExpr$)
  300. Declare Function report4toScreen% Lib "cb5demo.dll" (ByVal r4&, ByVal toScreen%)
  301.  
  302.  
  303. '===============================================================================================
  304. '
  305. '  TAG4 Access function prototypes
  306. '
  307. '================================================================================================
  308.  
  309. Declare Function tag4aliasCB& Lib "cb5demo.dll" Alias "tag4alias" (ByVal t4&)
  310. Declare Function tag4Descending% Lib "cb5demo.dll" (ByVal t4&)
  311. Declare Function tag4exprCB& Lib "cb5demo.dll" Alias "tag4expr" (ByVal t4&)
  312. Declare Function tag4filterCB& Lib "cb5demo.dll" Alias "tag4filter" (ByVal t4&)
  313. Declare Function tag4KeyLen% Lib "cb5demo.dll" (ByVal t4&)
  314. Declare Function tag4Unique% Lib "cb5demo.dll" (ByVal t4&)
  315. Declare Function tag4UniqueError% Lib "cb5demo.dll" (ByVal t4&, ByVal value%)
  316.  
  317. '===============================================================================================
  318. '
  319. '                            Tag Functions' Prototypes
  320. '
  321. '-----------------------------------------------------------------------------------------------
  322. Declare Function t4bottom% Lib "cb5demo.dll" (ByVal t4&)
  323. Declare Function t4eof% Lib "cb5demo.dll" (ByVal t4&)
  324. Declare Function t4go% Lib "cb5demo.dll" (ByVal t4&, ByVal key$, ByVal RecNum&)
  325. Declare Function t4keyCB& Lib "cb5demo.dll" Alias "t4key" (ByVal t4&)
  326. Declare Function t4open& Lib "cb5demo.dll" Alias "t4open_v" (ByVal dbPtr&, ByVal IndexName$)
  327. Declare Function t4position# Lib "cb5demo.dll" (ByVal t4&)
  328. Declare Function t4positionSet% Lib "cb5demo.dll" Alias "t4position_set" (ByVal t4&, ByVal Position#)
  329. Declare Function t4recno& Lib "cb5demo.dll" (ByVal t4&)
  330. Declare Function t4seek% Lib "cb5demo.dll" (ByVal t4&, ByVal key As Any, ByVal keyLength%)
  331. Declare Function t4skip& Lib "cb5demo.dll" (ByVal t4&, ByVal NumRecs&)
  332. Declare Function t4top% Lib "cb5demo.dll" (ByVal t4&)
  333.  
  334. '=======================================================================================
  335. '
  336. '                Utility function prototypes
  337. '
  338. '========================================================================================
  339.  
  340. Declare Function u4alloc& Lib "cb5demo.dll" (ByVal amt&)
  341. Declare Function u4allocFree& Lib "cb5demo.dll" Alias "u4alloc_free" (ByVal c4&, ByVal amt&)
  342. Declare Sub u4free Lib "cb5demo.dll" (ByVal memPtr&)
  343. Declare Function u4ncpy% Lib "cb5demo.dll" (ByVal MemPtr1$, ByVal memptr2&, ByVal memLength%)
  344. Declare Function u4ncpy2% Lib "cb5demo.dll" Alias "u4ncpy" (ByVal MemPtr1&, ByVal memptr2$, ByVal memLength%)
  345. Declare Sub u4memCpy Lib "cb5demo.dll" (ByVal dest$, ByVal source&, ByVal numCopy%)
  346.  
  347. '=======================================================================================
  348. '
  349. '                Misc. function prototypes
  350. '
  351. '========================================================================================
  352.  
  353. Declare Function v4Cstring& Lib "cb5demo.dll" (ByVal s$)
  354. Declare Sub v4Cstringfree Lib "cb5demo.dll" (ByVal s&)
  355.  
  356.  
  357. 'CodeBase Return Code Constants
  358.  
  359. Global Const r4success% = 0
  360. Global Const r4found% = 1
  361. Global Const r4after = 2
  362. Global Const r4eof = 3
  363. Global Const r4bof = 4
  364. Global Const r4entry = 5
  365. Global Const r4descending = 10
  366. Global Const r4unique = 20
  367. Global Const r4uniqueContinue = 25
  368. Global Const r4ignore = 40
  369. Global Const r4keep = 45
  370. Global Const r4locked = 50
  371. Global Const r4noCreate = 60
  372. Global Const r4noOpen = 70
  373. Global Const r4notag = 80
  374.  
  375. Global Const relate4filterRecord = 101
  376. Global Const relate4doRemove = 102
  377. Global Const relate4skipped = 104
  378. Global Const relate4blank = 105
  379. Global Const relate4skipRec = 106
  380. Global Const relate4terminate = 107
  381. Global Const relate4exact = 108
  382. Global Const relate4scan = 109
  383. Global Const relate4approx = 110
  384. Global Const relate4sortSkip = 120
  385. Global Const relate4sortDone = 121
  386.  
  387. 'CodeBasic Field Definition Constants
  388. Global Const r4logLen = 1
  389. Global Const r4dateLen = 8
  390. Global Const r4memoLen = 10
  391. Global Const r4str$ = "C"
  392. Global Const r4float$ = "F"
  393. Global Const r4num$ = "N"
  394. Global Const r4date$ = "D"
  395. Global Const r4log$ = "L"
  396. Global Const r4memo$ = "M"
  397.  
  398. 'Other CodeBasic Constants
  399. Global Const r4check = -5
  400.  
  401. 'CodeBasic Error Code Constants
  402. Global Const e4close = -10
  403. Global Const e4create = -20
  404. Global Const e4len = -30
  405. Global Const e4lenSet = -40
  406. Global Const e4lock = -50
  407. Global Const e4open = -60
  408. Global Const e4read = -70
  409. Global Const e4remove = -80
  410. Global Const e4rename = -90
  411. Global Const e4seek = -100
  412. Global Const e4unlock = -110
  413. Global Const e4write = -120
  414. Global Const e4data = -200
  415. Global Const e4fieldName = -210
  416. Global Const e4fieldType = -220
  417. Global Const e4recordLen = -230
  418. Global Const e4entry = -300
  419. Global Const e4index = -310
  420. Global Const e4tagName = -330
  421. Global Const e4unique = -340
  422. Global Const e4commaExpected = -400
  423. Global Const e4complete = -410
  424. Global Const e4dataName = -420
  425. Global Const e4lengthErr = -422
  426. Global Const e4notConstant = -425
  427. Global Const e4numParms = -430
  428. Global Const e4overflow = -440
  429. Global Const e4rightMissing = -450
  430. Global Const e4typeSub = -460
  431. Global Const e4unrecFunction = -470
  432. Global Const e4unrecOperator = -480
  433. Global Const e4unrecValue = -490
  434. Global Const e4undetermined = -500
  435. Global Const e4opt = -610
  436. Global Const e4optSuspend = -620
  437. Global Const e4optFlush = -630
  438. Global Const e4relate = -710
  439. Global Const e4lookupErr = -720
  440. Global Const e4info = -910
  441. Global Const e4memory = -920
  442. Global Const e4parm = -930
  443. Global Const e4result = -950
  444.  
  445. 'CodeControls Constants
  446. Global Const CB_TOP = 1
  447. Global Const CB_PREV = 2
  448. Global Const CB_SEARCH = 3
  449. Global Const CB_NEXT = 4
  450. Global Const CB_BOTTOM = 5
  451. Global Const CB_APPEND = 6
  452. Global Const CB_DEL = 7
  453. Global Const CB_UNDO = 8
  454. Global Const CB_FLUSH = 9
  455. Global Const CB_GO = 10
  456.  
  457. '=======================================================================================
  458. '
  459. '                CodeControls function prototypes
  460. '
  461. '========================================================================================
  462.  
  463.  
  464. 'CodeControls Constants
  465.  
  466. Global Const MASTER4NODATA% = 1
  467. Global Const MASTER4NOTAG% = 2
  468. Global Const MASTER4BADEXPR% = 3
  469. Global Const CTRL4BADFIELD% = 4
  470. Global Const CTRL4NOTAG% = 5
  471. Global Const CTRL4BADEXPR% = 6
  472.  
  473. Function b4String$ (p&)
  474.  
  475. 'This is a utility function for copying a 'C' string to a VB string.
  476.  
  477.     Dim s As String * 256, rc As Integer
  478.  
  479.     s$ = ""
  480.  
  481.     rc = u4ncpy(s, p, 256)
  482.  
  483.     b4String$ = Left$(s, rc)
  484.  
  485. End Function
  486.  
  487. Function code4dateFormat$ (c4Ptr&, Fmt$)
  488.  
  489. 'This function returns and optionally modifies the CODE4.dateFormat member
  490.  
  491.     Dim inString As String * 19
  492.     Dim DatePtr&, rc%
  493.  
  494.     'If Fmt$ = "" then return present date format,
  495.     'otherwise change date format to Fmt$
  496.     DatePtr = code4dateFormatCB(c4Ptr&, Fmt$)
  497.  
  498.      code4dateFormat = b4String(DatePtr)
  499.  
  500. End Function
  501.  
  502. Function d4alias$ (dbPtr&)
  503.  
  504. 'This function returns the data file alias
  505.  
  506.    Dim AliasPtr&
  507.  
  508.    'Get pointer to alias string
  509.    AliasPtr& = d4aliasCB(dbPtr)
  510.  
  511.    If AliasPtr& = 0 Then Exit Function
  512.  
  513.    d4alias = b4String(AliasPtr)
  514.  
  515. End Function
  516.  
  517. Function d4create& (ByVal cb&, dbname$, d() As FIELD4INFO, n() As TAG4INFO)
  518.  
  519.     ' d4create calls d4createCB() to create a new database.
  520.     ' This function is the same as d4createData() except that
  521.     ' it requires an additional parameter which it uses to
  522.     ' create tag information for a database.
  523.     '
  524.     ' Variable n is an array of type TAG4INFO which corresponds
  525.     ' to TAG4INFOCB, a structure that can be used by d4create.
  526.     ' The difference once again is merely the difference in the
  527.     ' representation of strings between C and Basic.
  528.     ' d4create takes the contents from the TAG4INFO structure
  529.     ' and builds a TAG4INFOCB structure which it passes to d4createCB().
  530.     ' Note: the TAG4INFOCB array is one size larger than the TAG4INFO
  531.     ' array.  The extra empty (zero filled) array element is the
  532.     ' way that d4createCB() detects the end of the array.
  533.     
  534.    
  535.     Dim i%
  536.     
  537.     Dim flb%
  538.     Dim fub%
  539.     Dim fs%
  540.     
  541.     Dim tlb%
  542.     Dim tub%
  543.     Dim ts%
  544.  
  545.  
  546.     flb = LBound(d)
  547.     fub = UBound(d)
  548.     fs = fub - flb + 1
  549.  
  550.  
  551.     ReDim f(1 To (fs + 1)) As FIELD4INFOCB
  552.     For i = 1 To fs
  553.     f(i).fname = v4Cstring(d((flb - 1) + i).fname)    ' note: this function allocates memory
  554.     f(i).ftype = Asc(d((flb - 1) + i).ftype)
  555.     f(i).flength = d((flb - 1) + i).flength
  556.     f(i).fdecimals = d((flb - 1) + i).fdecimals
  557.     Next i
  558.  
  559.     tlb = LBound(n)
  560.     tub = UBound(n)
  561.     ts = tub - tlb + 1
  562.     ReDim t(1 To (ts + 1)) As TAG4INFOCB
  563.     For i = 1 To ts
  564.     t(i).name = v4Cstring(n((tlb - 1) + i).name)
  565.     t(i).expression = v4Cstring(n((tlb - 1) + i).expression)
  566.     t(i).filter = v4Cstring(n((tlb - 1) + i).filter)
  567.     t(i).unique = n((tlb - 1) + i).unique
  568.     t(i).descending = n((tlb - 1) + i).descending
  569.     Next i
  570.     d4create = d4createCB(cb&, ByVal (dbname$), f(1), t(1))
  571.     
  572.     ' Since v4Cstring allocates memory for the storage of
  573.     ' C strings, we must free the memory after it has been
  574.     ' used.
  575.     For i = 1 To fs
  576.      Call v4Cstringfree(f(i).fname)
  577.     Next i
  578.  
  579.     For i = 1 To ts
  580.     Call v4Cstringfree(t(i).name)
  581.     Call v4Cstringfree(t(i).expression)
  582.     Call v4Cstringfree(t(i).filter)
  583.     Next i
  584.  
  585.  
  586. End Function
  587.  
  588. Function d4createData& (ByVal cb&, dbname$, d() As FIELD4INFO)
  589.  
  590.     ' d4createData() calls d4createCB() to create a new database.
  591.     ' d4create() builds the FIELD4INFOCB array which is
  592.     ' the one recognized by d4create (note that the only difference
  593.     ' is that the fname field is a string in type FIELD4INFO
  594.     ' and type long in FIELD4INFOCB which is how strings are represented
  595.     ' in C).  Furthermore, the size of f (our FIELD4INFOCB array) is one
  596.     ' larger than the size s of FIELD4INFO d.  This is because
  597.     ' d4create doesn't know the size of the array f and therefore it stops
  598.     ' when it reaches an array element that is filled with zeros which
  599.     ' the extra (s+1)'th element of f provides.
  600.  
  601.     Dim i%
  602.     Dim lb%
  603.     Dim ub%
  604.     Dim s%
  605.  
  606.     lb = LBound(d)
  607.     ub = UBound(d)
  608.     s = ub - lb + 1
  609.  
  610.  
  611.     ReDim f(1 To (s + 1)) As FIELD4INFOCB
  612.     For i = 1 To s
  613.     f(i).fname = v4Cstring(d((lb - 1) + i).fname)' note: this function allocates memory
  614.     f(i).ftype = Asc(d((lb - 1) + i).ftype)
  615.     f(i).flength = d((lb - 1) + i).flength
  616.     f(i).fdecimals = d((lb - 1) + i).fdecimals
  617.     
  618.     Next i
  619.  
  620.     d4createData = d4createCB(cb&, ByVal (dbname$), f(1), ByVal (0&))
  621.     
  622.     ' Since v4Cstring allocates memory for the storage of
  623.     ' C strings, we must free the memory after it has been
  624.     ' used.
  625.     For i = 1 To s
  626.       Call v4Cstringfree(f(i).fname)
  627.     Next i
  628.  
  629. End Function
  630.  
  631. Function d4fileName$ (dbfPtr&)
  632.  
  633.    d4fileName$ = b4String(d4fileNameCB(dbfPtr))
  634.  
  635. End Function
  636.  
  637. Function date4cdow$ (dateString$)
  638.     
  639. 'This function returns the day of the week in a character
  640. 'string based on the value in 'DateString'
  641.  
  642.     'Validate "dateString"
  643.     If dateString = "" Or Len(dateString) < 8 Then Exit Function
  644.  
  645.     Dim DatePtr&
  646.     DatePtr& = date4cdowCB(dateString)    'Get pointer to day
  647.     If DatePtr = 0 Then Exit Function     'Illegal date
  648.  
  649.      date4cdow = b4String(DatePtr)
  650.  
  651. End Function
  652.  
  653. Function date4cmonth$ (dateString$)
  654.     
  655. 'This function returns the month in 'DateString' as a
  656. 'character string
  657.  
  658.     'Validate "DateString"
  659.     If dateString = "" Or Len(dateString) < 8 Then Exit Function
  660.  
  661.     Dim DatePtr&
  662.     DatePtr& = date4cmonthCB(dateString)    'Get pointer to month
  663.     If DatePtr = 0 Then Exit Function       'Illegal date
  664.  
  665.      date4cmonth = b4String(DatePtr)                 'Return month name
  666.    
  667. End Function
  668.  
  669. Sub date4format (dateString$, Result$, pic$)
  670.  
  671. 'This functions formats Result$ using the date value
  672. ' in 'dateString$' and the format info. in 'Pic$'
  673.  
  674.     'Size Result$
  675.     Result$ = Space$(Len(pic$) + 1)
  676.  
  677.     Call date4formatCB(dateString$, Result$, pic$)
  678.     Result$ = Left$(Result$, Len(pic$))
  679.     
  680. End Sub
  681.  
  682. Sub date4init (Result$, dateString$, pic$)
  683.  
  684. 'This functions copies the date, specified by dateString,
  685. 'and formatted according to pic, into Result. The date copied
  686. 'will be in standard dBASE format,
  687.  
  688.     'Size Result$
  689.     Result$ = Space$(9)
  690.  
  691.     Call date4initCB(Result$, dateString$, pic$)
  692.     Result$ = Left$(Result$, 8)
  693.  
  694. End Sub
  695.  
  696. Sub date4today (dateS As String)
  697.  
  698.    If Len(dateS) < 8 Then dateS = Space$(8)
  699.    Call date4todayCB(dateS)
  700.  
  701. End Sub
  702.  
  703. Function f4memoStr$ (fPtr&)
  704. 'This function returns a string corresponding to the memo
  705. 'field pointer argument.
  706.  
  707.     Dim MemoLen&, MemoPtr&
  708.  
  709.     MemoLen& = f4memoLen(fPtr)          'Get memo length
  710.     MemoPtr& = f4memoPtr(fPtr)
  711.     If MemoPtr& = 0 Then Exit Function
  712.  
  713.     Dim MemoString$
  714.     MemoString = String$(MemoLen&, " ")
  715.  
  716.     'Copy 'MemoPtr' to VB string 'MemoString'
  717.     u4memCpy MemoString, MemoPtr, MemoLen
  718.            
  719.      f4memoStr = MemoString
  720.  
  721. End Function
  722.  
  723. Function f4name$ (fPtr&)
  724.  
  725. 'This function returns the name of a field
  726.  
  727.     Dim FldNamePtr&                     'Pointer to field name
  728.     Dim FldName As String * 11          'String to hold info
  729.     FldNamePtr& = f4nameCB(fPtr)        'Get pointer
  730.  
  731.      f4name = b4String(FldNamePtr)
  732.  
  733. End Function
  734.  
  735. Function f4str$ (Field&)
  736.                    
  737. 'This function returns the contents of a field
  738.  
  739.    Dim s$, fPtr&, flen%
  740.  
  741.    flen = f4len(Field)                 'Get field length
  742.    s = Space$(flen)                    'Make s$ one byte longer for null character that u4ncpy adds
  743.    fPtr& = f4ptr(Field)
  744.  
  745.    If fPtr& = 0 Then Exit Function
  746.    
  747.    u4memCpy s, fPtr, flen
  748.  
  749.    f4str = s
  750.  
  751. End Function
  752.  
  753. Function i4create& (ByVal dbPtr&, IndexName$, n() As TAG4INFO)
  754.  
  755.     ' i4create() calls i4createCB() to create a new
  756.     ' index file. Variable n is an array of type TAG4INFO
  757.     ' which corresponds to TAG4INFOCB, a structure that
  758.     ' can be used by i4createCB(). The difference once
  759.     ' again is merely the difference in the representation
  760.     ' of strings between C and Basic.
  761.     '
  762.     ' i4create() takes the contents from the TAG4INFO
  763.     ' structure and builds a TAG4INFOCB structure which
  764.     ' it passes to i4createCB(). Note: the TAG4INFOCB
  765.     ' arrary is one size larger than the TAG4INFO array.
  766.     ' The extra empty (zero filled) array element is the
  767.     ' way that d4create detects the end of the array.
  768.     '
  769.     ' Note also, that if 'IndexName' is an empty string,
  770.     ' the index file that is created will become a
  771.     ' "production" index file. i.e. it will be opened every
  772.     ' time the corresponding data file is opened.
  773.     
  774.     Dim i%
  775.     
  776.     Dim tlb%
  777.     Dim tub%
  778.     Dim ts%
  779.  
  780.     
  781.     tlb = LBound(n)
  782.     tub = UBound(n)
  783.     ts = tub - tlb + 1
  784.     ReDim t(1 To (ts + 1)) As TAG4INFOCB
  785.     For i = 1 To ts
  786.     t(i).name = v4Cstring(n((tlb - 1) + i).name)
  787.     t(i).expression = v4Cstring(n((tlb - 1) + i).expression)
  788.     t(i).filter = v4Cstring(n((tlb - 1) + i).filter)
  789.     t(i).unique = n((tlb - 1) + i).unique
  790.     t(i).descending = n((tlb - 1) + i).descending
  791.     Next i
  792.  
  793.     If IndexName$ = "" Then    'User wants production index file
  794.     i4create = i4createCB(dbPtr&, ByVal 0&, t(1))
  795.     Else
  796.     i4create = i4createCB(dbPtr&, IndexName$, t(1))
  797.     End If
  798.     
  799.     ' Since v4Cstring allocates memory for the storage of
  800.     ' C strings, we must free the memory after it has been
  801.     ' used.
  802.  
  803.     For i = 1 To ts
  804.      Call v4Cstringfree(t(i).name)
  805.      Call v4Cstringfree(t(i).expression)
  806.      Call v4Cstringfree(t(i).filter)
  807.     Next i
  808.  
  809.  
  810. End Function
  811.  
  812. Function i4open& (d4&, fname$)
  813.  
  814.    If fname = "" Then
  815.       i4open = i4openCB(d4&, ByVal 0&)   'Use data file name
  816.    Else
  817.       i4open = i4openCB(d4&, fname$)     'Use supplied name
  818.    End If
  819.  
  820. End Function
  821.  
  822. Function t4key$ (tPtr&)
  823.  
  824. 'This function returns the value of the current key
  825.    
  826.    Dim KeyPtr&, KeyLen%, KeyBuf$
  827.  
  828.    KeyLen = tag4KeyLen(tPtr)
  829.    KeyBuf = Space(KeyLen)
  830.  
  831.    'Get pointer to key info
  832.    KeyPtr = t4keyCB(tPtr)
  833.  
  834.    If KeyPtr = 0 Then Exit Function
  835.  
  836.     'Copy to VB String
  837.     u4memCpy KeyBuf, KeyPtr, KeyLen
  838.  
  839.     t4key = KeyBuf
  840.  
  841. End Function
  842.  
  843. Function tag4alias$ (tPtr&)
  844.     
  845. 'This function returns the alias of an index tag
  846.  
  847.     Dim AliasPtr&
  848.     Dim AliasName As String * 10
  849.  
  850.     'Get pointer to alias string
  851.     AliasPtr = tag4aliasCB(tPtr)
  852.  
  853.      tag4alias = b4String(AliasPtr)
  854.  
  855. End Function
  856.  
  857. Function tag4expr$ (tPtr&)
  858.  
  859. 'This function returns the original tag expression
  860.  
  861.     Dim ExprPtr&
  862.     Dim expr As String * 255
  863.  
  864.     'Get pointer to parsed dBASE expression
  865.     ExprPtr = tag4exprCB(tPtr)
  866.  
  867.     tag4expr = b4String(ExprPtr)
  868.  
  869. End Function
  870.  
  871. Function tag4Filter$ (tPtr&)
  872.  
  873. 'This function returns the tag filter expression
  874.     
  875.     Dim FilterPtr&
  876.     Dim filter As String * 255
  877.  
  878.     'Get pointer to parsed filter expression
  879.     FilterPtr& = tag4filterCB(tPtr&)
  880.  
  881.     If FilterPtr& = 0 Then Exit Function         'No filter
  882.  
  883.    tag4Filter = b4String(FilterPtr)
  884.  
  885. End Function
  886.  
  887. Function u4descend$ (charString$)
  888.  
  889.    Dim Result$, i%
  890.  
  891.    For i = 1 To Len(charString)
  892.     Result = Result + Chr$(128 And Asc(Mid$(charString, i, 1)))
  893.    Next
  894.  
  895.    u4descend = Result
  896.  
  897. End Function
  898.  
  899.