forked from difcareer/010templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DBFTemplate.bt
executable file
·59 lines (53 loc) · 1.41 KB
/
DBFTemplate.bt
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
//--------------------------------------
//--- 010 Editor v2.1.3 Binary Template
//
// File:
// Author:
// Revision:
// Purpose:
//--------------------------------------
string yearFrom1900 (char yy)
{
string s;
SPrintf(s, "%d", 1900 + yy);
return s;
}
struct DBF {
struct HEADER {
char version;
struct DATE_OF_LAST_UPDATE {
char yy <read=yearFrom1900,format=decimal>;
char mm <format=decimal>;
char dd <format=decimal>;
} DateOfLastUpdate;
int numberOfRecords;
short lengthOfHeaderStructure;
short lengthOfEachRecord;
char reserved[2];
char incompleteTrasaction <format=decimal>;
char encryptionFlag <format=decimal>;
int freeRecordThread;
int reserved1[2];
char mdxFlag <format=decimal>;
char languageDriver <format=decimal>;
short reserved2;
} header;
struct FIELD {
char fieldName[11];
char fieldType;
int fieldDataAddress;
char fieldLength <format=decimal>;
char decimalCount <format=decimal>;
short reserved;
char workAreaId <format=decimal>;
short reserved1;
char flags <format=hex>;
char reserved2[7];
char indexFieldFlag <format=decimal>;
} field[(header.lengthOfHeaderStructure-33)/sizeof(struct FIELD)];
char Terminator <format=hex>;
struct RECORD {
char deletedFlag;
char fields[header.lengthOfEachRecord-1];
} record [ header.numberOfRecords ] <optimize=false>;
} dbf <optimize=false>;