|
|
C Example and Function List
C Example:
/* List the MAILING.DBF data file ordered alphabetically by last name. */
#include "d4all.h"
void main (void) {
CODE4 codeBase;
DATA4 *dataFile;
TAG4 *lastName;
FIELD4 *field;
int rc, j;
code4init(&codeBase); /*Initialize CodeBase*/
dataFile = d4open(&codeBase, "MAILING"); /*Open MAILING.DBF*/
lastName = d4tag(dataFile, "LASTNAME");
d4tagSelect(dataFile, lastName); /*Select the last name index*/
d4top(dataFile); /*Go to top of data file*/
while(!d4eof(dataFile)) { /*While not end of file*/
printf( "\n %4ld ", d4recNo(dataFile)); /*Display the record numbers*/
for (j=1;j<=d4numFields(dataFile);j++) { /*For each field in data file*/
field = d4fieldJ(dataFile, j);
printf(" %s", f4str(field)); /*Show contents of the field*/
}
d4skip(dataFile, 1L); /*Move to next logical record*/
}
d4close(dataFile); /*Close the data file*/
}
CodeBase C Function List
Here are just a few of the 300 fully documented CodeBase functions:
Data File Functions
| d4append |
d4eof |
d4lockFile |
d4reccount |
d4top
|
| d4blank |
d4field |
d4lockGroup |
d4recno |
d4unlock
|
| d4bottom |
d4flush |
d4numFields |
d4record |
d4write
|
| d4close |
d4go |
d4open |
d4reindex |
d4zap
|
| d4create |
d4index |
d4pack |
d4seek |
|
| d4data |
d4lock |
d4position |
d4skip |
|
| d4delete |
d4lockAppend |
d4recall |
d4tagSelect |
|
Field Functions
| f4assign |
f4assignLong |
f4char |
f4len |
f4ptr
|
| f4assignChar |
f4assignN |
f4decimals |
f4long |
f4str
|
| f4assignDouble |
f4assignPtr |
f4double |
f4name |
f4true
|
| f4assignInt |
f4blank |
f4int |
f4ncpy |
f4type
|
Index File Functions
| i4close |
i4create |
i4open |
i4reindex |
i4tagAdd
|
Linked List Functions
| l4add |
l4addAfter |
l4addBefore |
l4first |
l4init |
| l4last |
l4numNodes |
l4next |
l4pop |
l4prev |
| l4remove |
|
|
|
|
Query & Join Functions
| relate4bottom |
relate4master |
relate4querySet |
relate4skip |
relate4top
|
Logging and Transaction Functions
| code4connect |
code4logFileName |
code4logOpenOff |
code4tranRollback |
| code4logCreate |
code4logOpen |
code4tranCommit |
code4tranStart |
|
|