summaryrefslogtreecommitdiff
path: root/1Tdata/xbase/xbase64-4.1.4/docs/html/xbc10.html
blob: 2889e6dc666fd997e868a514896350bdfe2be1b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
<!DOCTYPE HTML PUBLIC>
<HTML>
<TITLE>Xbase DBMS Chapter 10</TITLE>
<BODY BGCOLOR=#FFFFFF>
<H2><p align="center">Class xbDbf, xbDbf3, xbDbf4</p></H2>
<p align="center">Chapter Updated 04/28/23</p><hr>


<h4>This chapter documents the following classes:</h4><br><br>
<li>Class xbDbf  - Base class for handling DBF files.
<li>Class xbDbf3 - Derived class for handling DBF version III files.
<li>Class xbDbf4 - Derived class for handling DBF version IV files.


<br><br><br>
<h4>Highlights</h4>

<li>The xbDbf3 and xbDbf4 classes are used for accessing DBF data files.

<li>In line with relational theory, a each DBF file can be considered as a table.
The documentation uses the terms DBF and table interchangeably.<br>

<li>These classes contain methods for accessing and updating DBF files.

<li>The class structure is designed to support additional database file layouts.
To modify the library to support a new file type not currently supported,
create a derived class using xbDbf as a base class and create/modify methods needed
to support the new dbf file version.<br>

<li>Each open DBF file would have an associated instance of the approprate class.
Each instance maintains a record buffer, an original record buffer (if changes applied)
current reccord number, selected tag, lock status, record updated flag and other
misc info.

<li>The record updated flag tells the software to commit any updates to the data base
automatically if the auto commit option is turned on (default setting is on).  

<li>To use a DBF data file, first open it or create it.  When done, close it.

<li>The first byte of each record is a deletion flag.  Deleted records are marked for deletion
and not physically removed from the DBF file. They and can be undeleted with xbDbf::UndeleteRecord().
To physically remove deleted records from the DBF file, use xbDbf::Pack().


<li>The library will automatically post any updates if Auto Commit is turned on (default setting).
If Auto Commit is not on, the application program will need to issue xbDbf::Commit() or
xbDbf::Abort() commands to post updates.

<li>
The library automatically updates any open indices.  MDX indices are opened automatically.
For NDX style indices, early versions of DBase required the NDX files be explicitly opened in the
application. More current versions of available DBase ODBC drivers automatically open NDX indices 
with the addition of an <em>tablename.INF</em> file.  Xbase64 supports both scenarios.

<li>Xbase64 handles all record and file locking automatically and is programmed to work the same as the
original DBase products as far as locking goes.  If auto locking is be turned off, the application
is responsible for all locking activities in multi user environments.

<li>All field related methods operate on the current record.

<li>When accessing fields on a given record, processing fields by field number offers slightly better 
performance than processing by field name because the number has to be looked up if
the name is used.  The field number can be retrieved with xbDbf::FieldNo() when the application program
is initializing.

<li>Unless otherwise specified, the methods return either XB_NO_ERROR or an error as defined here: <a href=xbae.html>Error Codes</a>


<br><br><br><br>




<center>
<h2>Table Methods</h2>
<table border=1>
<tr><th width=35%>Method</th><th>Description</th><th>Parms</th></tr>
<tr><td>virtual xbInt16  Abort()</td><td>Cancel any updates not already committed to the table.</td></tr>
<tr><td>virtual xbInt16  AppendRecord()</td><td>Append the record buffer to the end of the table.</td></tr>
<tr><td>virtual xbInt16  BlankRecord()</td><td>Blank the current record buffer.</td></tr>
<tr><td>virtual xbInt16  Commit()</td><td>Commit any updates to the DBF file/table.</td></tr>
<tr><td>virtual xbInt16  Close()</td><td>Close the DBF file/table.</td></tr>
<tr><td>virtual xbInt16  CopyDbfStructure( xbDbf *dNewTable, const xbString &sTableName, const xbString &sTableAlias, xbInt16 iOverlay, xbInt16 iShareMode )</td><td>Copy structure to new DBF file.</td>
  <td>
    <em>dNewTable</em> - Pointer to new xbDbf class<br>
    <em>sTableName</em> - New Table name<br>
    <em>sTableAlias</em> - Alias for new table</br>
    <em>iOverlay</em><br>
      <li>xbTrue - Overlay if file exists<br>
      <li>xbFalse - Don't overlay<br>
    <em>iShareMode</em><br>
      <li>XB_SINGLE_USER<br>
      <li>XB_MULTI_USER
  </td>
</tr>

<tr><td>virtual xbInt16  CreateTable( const xbString &sTableName, const xbString &sAlias, xbSchema *pSchema, xbInt16 iOverlay, xbInt16 iShareMode ) = 0</td><td>Create new table / DBF file.</td>
  <td>
   <em>sTableName</em> - New Table name<br>
   <em>sAlias</em> - Alias for new table<br>
   <em>pSchema</em> - Pointer to field definition structure<br>
   <em>iOverlay</em><br>
      <li>xbTrue - Overlay if file exists<br>
      <li>xbFalse - Don't overlay<br>
   <em>iShareMode</em><br>
      <li>XB_SINGLE_USER<br>
      <li>XB_MULTI_USER
  </td>
</tr>

<tr><td>virtual xbInt16  DeleteTable()</td><td>Delete table / DBF file and all associated indices and memo files.</td></tr>

<tr><td>virtual xbInt16  DeleteAll( xbInt16 iOption )</td><td>Set or remove delete flags for all records in the table.</td>
  <td>
   <em>iOption</em><br>
     <li>0 - Set all delete flags<br>
     <li>1 - Remove all delete flags
 </td>
</tr>

<tr><td>virtual xbInt16  DeleteAllRecords()</td><td>Set delete flags for all records in the table.</td></tr>
<tr><td>virtual xbInt16  DeleteRecord()</td><td>Delete the current record.</td></tr>

<tr><td>virtual xbInt16  DumpHeader( xbInt16 iOption ) const</td><td>Dump DBF header information to the console.</td>
  <td>
   <em>iOption</em><br>
       <li>1 = Print header only<br>
       <li>2 = Field data only<br>
       <li>3 = Header and Field data<br>
       <li>4 = Header, Field and Memo header data if applicable
 </td>
</tr>

<tr><td>virtual xbInt16  DumpRecord( xbUInt32 ulRecNo, xbInt16 iOutputDest = 0, xbInt16 iOutputFmt = 0 )</td><td>Dump the contents of the specified record.</td>
  <td>
   <em>ulRecNo</em> - Record number of record to be dumped
   <em>iOutputDest</em><br>
       <li>0 = stdout<br>
       <li>1 = Syslog<br>
       <li>2 = Both<br>
   <em>iOutputFmt</em><br>
       <li>0 = with field names<br>
       <li>1 = 1 line per rec, no field names<br>
       <li>2 = 1 line per rec, first line is a list of field names.
  </td>
 </tr>

<tr><td>virtual xbInt16  GetAutoCommit() const</td><td>Get the Auto Commit status.</td></tr>
<tr><td>virtual xbInt16  GetAutoCommit( xbInt16 iOption ) const</td><td>Get the Auto Commit status.</td><td><em>iOption:</em><br>0 = Table Status<br>1 = System Status.</td></tr>
<tr><td>virtual xbBool   GetBof()</td><td>Returns true if beginning of file.</td></tr>
<tr><td>virtual xbUInt32 GetCurRecNo() const</td><td>Returns the current record number.</td></tr>
<tr><td>virtual xbInt16  GetDbfStatus() const</td><td>Returns Status<br>
   <li>0 - Closed<br>
   <li>1 - Open<br>
   <li>2 - Updates Pending
  </td>
</tr>

<tr><td>virtual xbBool   GetEof()</td><td>Returns true if end of file.</td></tr>
<tr><td>virtual xbInt32  GetFieldCnt() const</td><td>Returns the number of fields in the table.</td></tr>
<tr><td>virtual xbInt16  GetFirstRecord()</td><td>Retrieve the first active (not deleted) record in the table.</td></tr>
<tr><td>virtual xbInt16  GetFirstRecord( xbInt16 iOption )</td><td>Retrieve the first record in the table.</td>
 <td>
  <em>iOption</em><br>
   <li>XB_ALL_RECS<br>
   <li>XB_ACTIVE_RECS<br>
   <li>XB_DELETED_RECS
 </td>
</tr>
<tr><td>virtual xbUInt16 GetHeaderLen() const</td><td>Returns the length of the header portion within the DBF file.</td></tr>
<tr><td>virtual xbInt16  GetLastRecord()</td><td>Retrieve the last active (not deleted) record in the table.</td></tr>
<tr><td>virtual xbInt16  GetLastRecord( xbInt16 iOption )</td><td>Retrieve the last record in the table.</td>
 <td>
  <em>iOption</em><br>
    <li>XB_ALL_RECS<br>
    <li>XB_ACTIVE_RECS<br>
    <li>XB_DELETED_RECS
 </td>
</tr>


<tr><td>virtual xbInt16  GetNextRecord()</td><td>Retrieve the next active (not deleted) record in the table.</td></tr>
<tr><td>virtual xbInt16  GetNextRecord( xbInt16 iOption )</td><td>Retrieve the next record in the table.</td>
 <td>
  <em>iOption</em><br>
   <li>XB_ALL_RECS<br>
   <li>XB_ACTIVE_RECS<br>
   <li>XB_DELETED_RECS
 </td>
</tr>

<tr><td>virtual xbInt16  GetNextRecord( xbInt16 iOption, xbUInt32 ulStartRec )</td><td>Retrieve the next record in the table.</td>
 <td>
  <em>iOption</em><br> 
   <li>XB_ALL_RECS<br>
   <li>XB_ACTIVE_RECS<br>
   <li>XB_DELETED_RECS<br>
  <em>ulStartRec</em> is the position to start from.
 </td>
</tr>

<tr><td>virtual xbInt16  GetPrevRecord()</td><td>Retrieve the previous active (not deleted) record in the table.</td></tr>
<tr><td>virtual xbInt16  GetPrevRecord( xbInt16 iOption )</td><td>Retrieve the previous record in the table.</td>
 <td>
  <em>iOption</em><br>
   <li>XB_ALL_RECS<br>
   <li>XB_ACTIVE_RECS<br>
   <li>XB_DELETED_RECS
 </td>
</tr>
<tr><td>virtual xbInt16  GetRecord( xbUInt32 ulRecNo )</td><td>Retrieve record <em>ulRecNo</em>.</td><td><em>ulRecNo</em> - Record number to retrieve</td></tr>

<tr><td>virtual xbInt16  GetRecordCnt( xbUInt32 & ulRecCnt )</td><td>Returns record count in <em>ulRecCnt</em>.</td>
 <td>
  <em>ulRecCnt</em> - Output number of records in table</tr>

<tr><td>virtual char *   GetRecordBuf( xbInt16 iOpt = 0 ) const</td><td>Returns pointer to record buffer.</td>
 <td>
  <em>iOpt</em><br>
   <li>0 for RecBuf (current contents)<br>
   <li>1 for RecBuf2 (original contents)
 </td>
</tr>

<tr><td>virtual xbUInt16 GetRecordLen() const</td><td>Returns the record length</td></tr>
<tr><td>virtual const    xbString &GetTblAlias() const</td><td>Returns the table alias.  Aliases can be used to manage multiple instances of the same open table.</td></tr>
<tr><td>virtual xbInt16  GetVersion() const = 0</td><td>Returns 3 for DBase III version files, returns 4 for DBase IV version files.</td></tr>
<tr><td>virtual xbXBase  *GetXbasePtr() const</td><td>Returns the xbase pointer.</td></tr>
<tr><td>virtual xbBool   MemoFieldsExist() const</td><td>Returns true if the table has any associated memo fields.</td></tr>

<tr><td>virtual xbInt16  Open( const xbString &sTableName )</td><td>Open a table (DBF file).</td>
 <td>
  <em>sTableName</em> - Table name
 </td>
</tr>

<tr><td>virtual xbInt16  Open( const xbString &sTableName, const xbString &sAlias )</td><td>Open a table (DBF file).</td>
<td>
  <em>sTableName</em> - Table name<br>
  <em>sAlias</em> - Alias name
 </td>
</tr>


<tr><td>virtual xbInt16  Open( const xbString &sTableName, const xbString &sAlias, xbInt16 iOpenMode, xbInt16 iShareMode ) = 0</td><td>Open a table (DBF file).</td>
 <td>
  <em>sTableName</em> - Table name<br>
  <em>sAlias</em> - Alias name<br>
  <em>iOpenMode</em><br>
   <li>XB_READ<br>
   <li>XB_READ_WRITE<br>
  <em>iShareMode</em><br>
   <li>XB_SINGLE_USER<br>
   <li>XB_MULTI_USER
 </td>
</tr>


<tr><td>virtual xbInt16  Pack()</td><td>Pack the table, physically remove any records flagged for deletion.</td></tr>
<tr><td>virtual xbInt16  Pack( xbUInt32 &ulDeletedRecCnt )</td><td>Pack the table, physically remove any records flagged for deletion.<br></td>
 <td><em>ulDeletedRecordCnt</em> - Output - number of deleted records.</td></tr>

<tr><td>virtual xbInt16  PutRecord()</td><td>Write record buffer to current location</td></tr>

<tr><td>virtual xbInt16  PutRecord( xbUInt32 ulRecNo )</td><td>Write record buffer to record position <em>ulRecNo</em>.</td>
 <td>
  <em>ulRecNo</em> - Record number to write.
 </td>
</tr>

<tr><td>virtual xbInt16  RecordDeleted( xbInt16 iOpt = 0 ) const</td><td>Returns true if currect record is flagged for deletion, otherwise returns false.</td>
 <td>
  <em>iOpt</em><br>
   <li>0 - check RecBuf (current contents)<br>
   <li>1 - check RecBuf2 (original contents)
 </td>
</tr>


<tr><td>virtual xbInt16  Rename( const xbString sNewName ) = 0</td><td>Rename the table.</td>
 <td>
  <em>sNewName</em> - New tablename.
 </td>
</tr>

<tr><td>virtual xbInt16  SetAutoCommit( xbInt16 iAutoCommit )</td><td>Set table specific auto commit setting.</td>
 <td>
  <em>iAutoCommit</em><br>
   <li>0 - Auto Commit off<br>
   <li>1 - Auto Commit on
 </td>
</tr>

<tr><td>virtual xbInt16  UndeleteAllRecords()</td><td>Undelete all records in table flagged for deletion.</td></tr>
<tr><td>virtual xbInt16  UndeleteRecord()</td><td>Undelete the current record.</td></tr>
<tr><td>virtual xbInt16  Zap()</td><td>Initialize the table.</td></tr>
</table>

<br><br><br>



<h2>Field Methods</h2>

<table border=1>
<tr><th width=50%>Method</th><th>Description</th><th>Parms</th></tr>
<tr><td>virtual xbInt16 GetField(xbInt16 iFieldNo, xbString &sFieldValue, xbInt16 iRecBufSw ) const</td><td>Get string field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>sFieldValue</em> Output string<br>
  <em>iRecBufSw</em> Record buffer to pull data from.<br>
   <li>0 - current buffer
   <li>1 - original buffer
</td></tr>

<tr><td>virtual xbInt16 GetField(xbInt16 iFieldNo, xbString &sFieldValue) const</td><td>Get string field.</td>
 <td>
  <em>iFieldNo</em> Input -  Field number to retrieve<br>
  <em>sFieldValue</em> Output string</td></tr>
 </td>
</tr>

<tr><td>virtual xbInt16 GetField(const xbString &sFieldName, xbString &sFieldValue) const</td><td>Get string field.</td>
 <td>
  <em>sFieldName</em> Input -  Field name to retrieve<br>
  <em>sFieldValue</em> Output string</td></tr>
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldDecimal( xbInt16 iFieldNo, xbInt16 &iFieldDecimal ) const</td><td>Get decimal field.</td>
 <td>
  <em>iFieldNo</em> Input -  Field number to retrieve<br>
  <em>iFieldDecimal</em> Output - Number of decimals defined for field
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldDecimal( const xbString &sFieldName, xbInt16 &iFieldDecimal ) const</td><td>Get decimal field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>iFieldDecimal</em> Output - Number of decimals defined for field
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldLen( xbInt16 iFieldNo, xbInt16 &iFieldLen ) const</td><td>Get field length.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>iFieldLen</em> Output - Field length of field
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldLen( const xbString &sFieldName, xbInt16 &iFieldLen ) const</td><td>Get field length.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>iFieldLen</em> Output - Field length of field
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldName( xbInt16 iFieldNo, xbString &sFieldName ) const</td><td>Get field name.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>sFieldName</em> Output - Field name<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldNo( const xbString &sFieldName, xbInt16 &iFieldNo ) const</td><td>Get field number.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>iFieldNo</em> Output - Field number<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldNo( const xbString &sFieldName ) const</td><td>Returns a field number for a given field name.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
 </td>
</tr>


<tr><td>virtual xbInt16 GetFieldType( xbInt16 iFieldNo, char &cFieldType ) const</td><td>Get field type.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>cFieldType</em> Output - Field type
 </td>
</tr>

<tr><td>virtual xbInt16 GetFieldType( const xbString &sFieldName, char &cFieldType ) const</td><td>Get field type.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>cFieldType</em> Output - Field type
 </td>
</tr>

<tr><td>virtual xbInt16 PutField( const xbString &sFieldName, const xbString &sFieldData )</td><td>Put string field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>sFieldData</em> Input - Update value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 PutField( xbInt16 iFieldNo, const xbString &sFieldData )</td><td>Put string field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>sFieldData</em> Input - Update value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 PutLogicalField( xbInt16 iFieldNo, const xbString &sFieldData )</td><td>Put logicial field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>sFieldData</em> Input - Update value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 PutLogicalField( const xbString &sFieldName, const  xbString &sFieldData )</td><td>Put logical field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>sFieldData</em> Input - Update value<br></td></tr>
 </td>
</tr>

<tr><td>virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbString &sFieldData ) const</td><td>Get logical field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>sFieldData</em> Output - String name to put result<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetLogicalField( const xbString &sFieldName, xbString &sFieldData) const</td><td>Get logical field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>sFieldData</em> Output - String name to put result<br>
 </td>
</tr>

<tr><td>virtual xbInt16 PutLogicalField( xbInt16 iFieldNo, xbBool bFieldData )</td><td>Put logical field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>bFieldData</em> Output - Bool value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 PutLogicalField( const xbString &sFieldName, xbBool bFieldData )</td><td>Put logical field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>bFieldData</em> Output - Bool value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbBool &bFieldData ) const</td><td>Get logical field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>bFieldData</em> Output - Bool value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetLogicalField( xbInt16 iFieldNo, xbBool &bFieldData, xbInt16 iRecBufSw ) const</td><td>Get logical field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>bFieldData</em> Output - Bool value<br>
  <em>iRecBufSw</em> Record buffer to pull data from.<br>
   <li>0 - current buffer
   <li>1 - original buffer, before any updates
 </td>
</tr>

<tr><td>virtual xbInt16 GetLogicalField( const xbString &sFieldName, xbBool &bFieldData) const</td><td>Get logical field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>bFieldData</em> Output - Bool value<br>
 </td>
</tr>

<tr><td>virtual xbInt16 GetLongField( xbInt16 iFieldNo, xbInt32 &lFieldValue ) const</td><td>Get long field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  </em>lFieldValue<em> Output - xbInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetLongField( const xbString &sFieldName, xbInt32 &lFieldValue ) const</td><td>Get long field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  </em>lFieldValue<em> Output - xbInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 PutLongField( xbInt16 iFieldNo, xbInt32 lFieldValue )</td><td>Put long field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>lFieldValue<em> Output - xbInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 PutLongField( const xbString &sFieldName, xbInt32 lFieldValue )</td><td>Put long field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>lFieldValue<em> Output - xbInt32 update value
 </td>
</tr>

<tr><td>virtual xbInt16 GetULongField( xbInt16 iFieldNo, xbUInt32 &lFieldValue ) const</td><td>Get unsigned long field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>ulFieldValue<em> Output - xbUInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetULongField( const xbString &sFieldName, xbUInt32 &lFieldValue ) const</td><td>Get unsigned long field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>ylFieldValue<em> Output - xbUInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 PutULongField( xbInt16 iFieldNo, xbUInt32 lFieldValue )</td><td>Put unsigned long field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>lFieldValue<em> Output - xbInt32 update value
 </td>
</tr>

<tr><td>virtual xbInt16 PutULongField( const xbString &sFieldNo, xbUInt32 lFieldValue )</td><td>Put unsigned long field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>lFieldValue<em> Output - xbUInt32 update value
 </td>
</tr>

<tr><td>virtual xbInt16 GetDoubleField( xbInt16 FieldNo, xbDouble &dFieldValue ) const</td><td>Get double field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>dFieldValue<em> Output - xbDouble field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetDoubleField( xbInt16 FieldNo, xbDouble &dFieldValue, xbInt16 iRecBufSw ) const</td><td>Get double field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>dFieldValue<em> Output - xbDouble field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetDoubleField( const xbString &sFieldName, xbDouble &dFieldValue ) const</td><td>Get double field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>dFieldValue<em> Output - xbDouble field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 PutDoubleField( xbInt16 FieldNo, xbDouble dFieldValue )</td><td>Put double field.</td>
 <td>
  <em>sFieldNo</em> Input - Field number to update<br>
  <em>dFieldValue<em> Output - xbDouble update value
 </td>
</tr>


<tr><td>virtual xbInt16 PutDoubleField( const xbString &FieldName, xbDouble dFieldValue )</td><td>Put double field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>dFieldValue<em> Output - xbDouble update value
 </td>
</tr>

<tr><td>virtual xbInt16 GetFloatField( xbInt16 iFieldNo, xbFloat &fFieldValue ) const</td><td>Get float field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>fFieldValue<em> Output - xbFloat field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetFloatField( const xbString &sFieldName, xbFloat &fFieldValue ) const</td><td>Get float field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>fFieldValue<em> Output - xbFloat field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 PutFloatField( xbInt16 iFieldNo, xbFloat fFieldValue )</td><td>Put float field.</td>
 <td>
  <em>sFieldName</em> Input - Field number to update<br>
  <em>fFieldValue<em> Output - xbFloat update value
 </td>
</tr>

<tr><td>virtual xbInt16 PutFloatField( const xbString &sFieldName, xbFloat fFieldValue )</td><td>Put float field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>fFieldValue<em> Output - xbFloat update value
 </td>
</tr>

<tr><td>virtual xbInt16 GetDateField( xbInt16 iFieldNo, xbDate &dt ) const</td><td>Get date field.</td>
 <td>
  <em>iFieldNo</em> Input - Field number to retrieve<br>
  <em>dt<em> Output - xbDate field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetDateField( const xbString &sFieldName, xbDate &dt ) const</td><td>Get date field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to retrieve<br>
  <em>dt<em> Output - xbDate field to put result
 </td
</tr>

<tr><td>virtual xbInt16 PutDateField( xbInt16 iFieldNo, const xbDate &dt )</td><td>Put date field.</td>
 <td>
  <em>sFieldName</em> Input - Field number to update<br>
  <em>dt</em> Output - xbDate update value
 </td>
</tr>

<tr><td>virtual xbInt16 PutDateField( const xbString &sFieldName, const xbDate &dt )</td><td>Put date field.</td>
 <td>
  <em>sFieldName</em> Input - Field name to update<br>
  <em>dt</em> Output - xbDate update value
 </td>
</tr>

<tr><td>virtual xbInt16  GetNullSts( xbInt16 iFieldNo, xbBool &bIsNull ) const<br>
        virtual xbInt16  GetNullSts( const xbString &sFieldName, xbBool &bIsNull ) const<br>
        virtual xbInt16  GetNullSts( xbInt16 iFieldNo, xbBool &bIsNull, xbInt16 iRecBufSw ) const</td>
 <td>Get Field Null Status</td>
 <td>
  <em>sFieldName</em> Input - Field name to check<br>
  <em>iFieldNo</em> Input - Field no to check<br>
  <em>bIsNull</em> Output - True if the field is null (all spaces).<br>
  <em>iRecBufSw</em> Record buffer to pull data from.<br>
   <li>0 - current buffer
   <li>1 - original buffer
 </td>
</tr>

</table>



<br><br><br>
<h2>Memo File/Field Methods</h2>

<table border=1>
<tr><th>Method</th><th>Description</th><th>Parms</th></tr>
<tr><td>virtual xbInt16 GetMemoFieldCnt() const</td><td>Returns number of memo fields in the table.</td></tr>
<tr><td>virtual xbMemo *GetMemoPtr()</td><td>Returns a pointer to the associated memo file instance.</td></tr>
<tr><td>virtual xbUInt32 GetCreateMemoBlockSize() const</td><td>Returns the block size a new memo file will be created with.  Block sizes are in 512 byte increments.</td></tr>
<tr><td>virtual xbInt16 GetMemoField( xbInt16 iFldNo, xbString &sMemoData )</td><td>Get memo field data.</td>
 <td>
  <em>iFldNo</em> Input - Memo field number to retrieve<br>
  <em>sMemoData</em> Output - xbString field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetMemoField( const xbString & sFldName, xbString &sMemoData )</td><td>Get memo field data.</td>
 <td>
  <em>iFldName</em> Input - Memo field name to retrieve<br>
  <em>sMemoData</em> Output - xbString field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetMemoFieldLen( xbInt16 iFldNo, xbUInt32 &ulMemoFieldLen )</td><td>Get memo field length.</td>
 <td>
  <em>iFldNo</em> Input - Memo field number to retrieve<br>
  <em>ulMemoFieldLen</em> Output - xbUInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbInt16 GetMemoFieldLen( const xbString & sFldName, xbUInt32 &ulMemoFieldLen )</td><td>Get memo field length.</td>
 <td>
  <em>iFldName</em> Input - Memo field name to retrieve<br>
  <em>ulMemoFieldLen</em> Output - xbUInt32 field to put result
 </td>
</tr>

<tr><td>virtual xbBool MemoFieldExists( xbInt16 iFieldNo ) const</td><td>Returns xbTrue if memo field exists, else returns xbFalse.</td>
 <td>
  <em>iFieldNo</em> Input - field number
 </td>
</tr>

<tr><td>virtual xbBool MemoFieldExists( const xbString &sFieldName ) const</td><td>Returns xbTrue if memo field exists, else returns xbFalse.</td>
 <td>
  <em>sFieldName</em> Input - field name
 </td>
</tr>

<tr><td>virtual xbInt16 SetCreateMemoBlockSize( xbUInt32 ulBlockSize ) = 0</td><td>Set the block size for the memo file.  Must be called before memo file is created.</td>
 <td>
  <em>ulBlockSize</em> Input - New block size in 512 byte increments
 </td>
</tr>

<tr><td>virtual xbInt16 UpdateMemoField( xbInt16 iFldNo, const xbString &sMemoData )</td><td>Update memo field.</td>
 <td>
  <em>iFldNo</em> Input - Memo field number to update<br>
  <em>sMemoData</em> Input - Memo data to update
 </td>
</tr>

<tr><td>virtual xbInt16 UpdateMemoField( const xbString & sFldName, const xbString &sMemoData )</td><td>Update memo field.</td>
 <td>
  <em>iFldName</em> Input - Memo field name to update<br>
  <em>sMemoData</em> Input - Memo data to update
 </td>
</tr>
</table>




<br><br><br>
<h2>Lock Methods</h2>
<table border=1>
<tr><td colspan=3>

If auto locking is turned on (default setting), xbase64 handles locking automatically.<br>
If auto locking is turned off and application is running in a multi user environment, then 
locking functions will need to be handled by the application program.
</td></tr>

<tr><th>Method</th><th>Description</th><th>Parms</th></tr>
<tr><td>virtual xbInt16 LockTable( xbInt16 iLockFunction )</td><td>Lock the table.</td>
 <td>
  <em>LockFunction</em><br>
   <li>XB_LOCK<br>
   <li>XB_UNLOCK
 </td>
</tr>
<tr><td>virtual xbInt16 LockRecord( xbInt16 iLockFunction, xbUInt32 ulRecNo )</td><td>Lock record.</td>
 <td>
  <em>iLockFunction</em><br>
   <li>XB_LOCK <br>
   <li>XB_UNLOCK<br>
   <em>ulRecNo</em> - Record number to lock or unlock
 </td>
</tr>
<tr><td>virtual xbInt16 LockAppend( xbInt16 iLockFunction )</td><td>Lock append bytes for adding new record.</td>
 <td>
  <em>iLockFunction</em><br>
   <li>XB_LOCK<br>
   <li>XB_UNLOCK
 </td>
</tr>
<tr><td>virtual xbInt16 LockHeader( xbInt16 iLockFunction )</td><td>Lock table header bytes for updating table.</td>
 <td>
  <em>iLockFunction</em><br>
   <li>XB_LOCK<br>
   <li>XB_UNLOCK
 </td>
</tr>
<tr><td>virtual xbInt16 LockMemo( xbInt16 iLockFunction )</td><td>Lock memo table for update.
 <td>
  <em>iLockFunction</em><br>
   <li>XB_LOCK<br>
   <li>XB_UNLOCK
 </td>
</tr>
<tr><td>virtual xbBool  GetMemoLocked() const</td><td>Returns the memo lock status.</td></tr>

<tr><td>virtual xbInt16 LockIndices( xbInt16 iLockFunction )</td><td>Lock indices for update.</td>
 <td>
  <em>iLockFunction</em><br>
   <li>XB_LOCK<br>
   <li>XB_UNLOCK
 </td>
</tr>
<tr><td>xbInt16 GetAutoLock() const</td><td>Retrieve current auto lock status.</td></tr>

<tr><td>void SetAutoLock( xbInt16 iAutoLock )</td><td>Set autolock status for table</td>
 <td>
  <em>iAutoLock</em><br>
   <li>1 - Use auto lock for this table.<br>
   <li>0 - Don't use auto lock for this table.<br>
   <li>-1 - (minus one) Use system default.
 </td>
</tr>

<tr><td>xbInt16 GetLockFlavor() const</td><td>Always returns 1.  Included for potential future alternative locking schemes.</td></tr>
<tr><td>void SetLockFlavor( xbInt16 iLockFlavor )</td><td>For future use. Included for potential future alternative locking schemes.</td></tr>
<tr><td>xbBool GetTableLocked() const</td><td>Returns Table Locked status.</td></tr>
<tr><td>xbBool GetHeaderLocked() const</td><td>Returns Header Locked Status.</td></tr>
<tr><td>xbUInt32 GetAppendLocked() const</td><td>Returns Append Bytes locked status.</td></tr>
<tr><td>xbLinkListNode<xbUInt32> * GetFirstRecLock() const</td><td>Returns pointer to linked list of record locks.</td></tr>
<tr><td>void DumpTableLockStatus() const</td><td>Dumps all lock information for debugging purposes.</td></tr>
</table>



<br><br><br>
<h2>Index Methods</h2>
<table border=1>
<tr><th width=35%>Method</th><th width=35%>Description</th><th>Parms</th></tr>
<tr><td> virtual xbInt16 CheckTagIntegrity( xbInt16 iTagOpt, xbInt16 iOutputOpt )</td><td>For debugging, check tag integrity.</td>
 <td>
  <em>iTagOpt</em><br>
   <li>0 - Check current tag<br>
   <li>1 - Check all tags<br>
  <em>iOutputOpt</em><br>
   <li>0 = stdout<br>
   <li>1 = Syslog<br>
   <li>2 = Both
 </td>
</tr>

<tr><td> virtual xbInt16 CloseIndexFile( xbIx *pIx )</td><td>Close an index file.</td>
 <td>
  <em>pIx</em> Pointer to index file instance.
</tr>

<tr><td> virtual xbInt16 CreateTag( const xbString &sIxType, const xbString &sName, const xbString &sKey, const xbString &sFilter,
               xbInt16 iDescending, xbInt16 iUnique, xbInt16 iOverLay, xbIx **xbIxOut, void **vpTagOut )</td>
 <td>Create index tag</td>
 <td>
  <em>sIxType</em> Input - MDX or NDX<br>
  <em>sName</em> Input - Tag Name<br>
  <em>sKey</em> Input - Key Expression<br>
  <em>sFilter</em> Input - Filter Expression (MDX only)<br>
  <em>iDescending</em> Input - xbTrue for descending, xbFalse ascending<br>
  <em>iUnique</em> Input - xbTrue for unique, xbFalse not unique<br>
  <em>iOverlay</em> Input - xbTrue to overlay if existing file exists<br>
  <em>**xbIxOut</em> Output - Pointer to ix instance<br>
  <em>**vpTagOut</em> Output - Pointer to tag
 </td>
</tr>

<tr><td> virtual xbInt16 DeleteTag( const xbString &sIxType, const xbString &sName )</td><td>Delete a tag.</td>
 <td>
  <em>sIxType</em> Input - MDX or NDX<br>
  <em>sName</em> Input - Tag Name<br>
  <em>sKey</em> Input - Key Expression
 </td>
</tr>

<tr><td> virtual xbInt16 DeleteAllIndexFiles()</td><td>Delete all indices for table.</td></tr>

<tr><td> virtual xbInt16 Find( xbString &sKey )</td><td>Find xbString key for current tag (assumes character index).</td>
 <td>
  <em>sKey</em> - String search key
 </td>
</tr>

<tr><td> virtual xbInt16 Find( xbDate &dtKey )</td><td>Find xbDate key for current tag(assumes date index).</td>
 <td>
  <em>dtKey</em> - Date search key
 </td>
</tr>

<tr><td> virtual xbInt16 Find( xbDouble &dKey )</td><td>Find numeric key for current tag (assumes numeric index).</td>
 <td>
  <em>dKey</em> - Nueric search key
 </td>
</tr>

<tr><td> virtual xbIx *GetCurIx() const</td><td>Returns pointer to current index file.</td></tr>
<tr><td> virtual void *GetCurTag() const</td><td>Returns pointer to current tag.</td></tr>
<tr><td> virtual xbInt16 GetFirstKey()</td><td>Get the first key for the current tag, reposition current record.</td></tr>
<tr><td> virtual xbInt16 GetNextKey()</td><td>Get the next key for the current tag, reposition current record.</td></tr>
<tr><td> virtual xbInt16 GetPrevKey()</td><td>Get the previous key for the current tag, reposition current record.</td></tr>
<tr><td> virtual xbInt16 GetLastKey()</td><td>Get the last key for the current tag, reposition current record.</td></tr>
<tr><td> virtual const xbString &GetCurIxType() const</td><td>Returns the current index type.</td></tr>
<tr><td> virtual const xbString &GetCurTagName() const</td><td>Returns the current tag name.</td></tr>
<tr><td> virtual xbIxList *GetIxList() const</td><td>Returns a pointer to list of open indices.</td></tr>
<tr><td> virtual xbInt32 GetPhysicalIxCnt () const</td><td>Returns the count of open index files for the table.</td></tr>
<tr><td> xbLinkListNode<xbTag *> *GetTagList   () const</td><td>Returns a pointer to a list of tags for the table.</td></tr>
<tr><td> virtual xbInt16 OpenIndex( const xbString &sIxType, const xbString &sIndexName )</td>
 <td>Open the index.<br>MDX index files are opened automatically.<br>NDX index files can be opened automatically.</td>
 <td>
  <em>sIxType</em><br>
   <li>NDX<br>
   <li>MDX<br>
  <em>sIndexName</em> - index file name
 </td>
</tr>

<tr><td> virtual xbInt16 Reindex( xbInt16 iTagOpt )</td><td>Reindex</td>
 <td>
  <em>iTagOpt</em><br>
   <li>0 - Reindex current tag<br>
   <li>1 - Reindex all tags
 </td>
</tr>

<tr><td> virtual xbInt16 SetCurTag( const xbString &sTagName )</td><td>Set current tag.</td>
 <td>
  <em>sTagName</em> Tag name
 </td>
</tr>

<tr><td> virtual void SetCurTag( const xbString &sIxType, xbIx *pIx, void *vpTag )</td><td>Set current tag.</td>
 <td>
  <em>sIxType</em><br>
   <li>NDX<br>
   <li>MDX<br>
  <em>pIx</em> - Pointer to index object<br>
  <em>vpTag</em> - Pointer to tag object
 </td>
</tr>

<tr><td> virtual xbInt16 AssociateIndex( const xbString &sType, const xbString &sName, xbInt16 iOption )</td>
 <td>Use this method to add an NDX index file name to an INF file.<br>
     When a DBF file is opened, Xbase64 automatically opens NDX index files that are included in the appropriate INF file.
     This is also used for ODBC compatibility with other xbase type tools.
 </td>
 <td>
  <em>sIxType</em> Currently only NDX.<br> Future versions can support additional non prod index types.<br>
  <em>sIxName</em> The index name.<br>
  <em>iOpt</em><br>
   <li>0 - Add index to .INF if not already there<br>
   <li>1 - Remove index from .INF if it exists
 </td>
</tr>

<tr><td> xbLinkListNode<xbString> *GetInfList() const</td><td>Returns list of INF file entries.</td></tr>
</table>

<br><br><br>
<h2>Block Read Methods</h2>
<table border=1>
<tr><th>Method</th><th>Description</th></tr>
<tr><td>xbInt16 DisableBlockReadProcessing()</td><td>Disable block read processing for table.
<tr><td>xbInt16 EnableBlockReadProcessing()</td>
 <td>Enable block read processing for table.<br>
     This significantly speeds up processing speed if reading from the file sequentially.<br>
     For random access, better performance will be achieved with block reading turned off.
 </td>
</tr>
<tr><td>xbBool GetBlockReadStatus() const</td><td>Get block read status.</td></tr>
</table>

</center>



<br><br>
<hr>
<p><img src="xbase.jpg"><br><hr>
</BODY>
</HTML>