ID Number: Q79192
3.00
WINDOWS
Summary:
This article documents the file format used by Windows Cardfile. All
numbers in this document, including those in the descriptive text,
should be interpreted as hexadecimal numerals. All data pointers and
count bytes in the file are unsigned binary/hexadecimal integers in
least-to-most significant format. All text in the file is saved in low
ASCII format. In the text section of a card's data, <CR> is always
followed by <LF>.
More Information:
The Cardfile file format is as follows:
Byte # Description
------ -----------
0 - 2 Signature bytes -- always "MGC" (4D 47 43)
3 - 4 Number of cards in file
Beyond the first 5 bytes are the index lines -- the information about
the top line of each card. The first index entry begins at byte 5 in
the file, and successive entries begin 34 bytes after the beginning of
the last index entry (the second entry at byte 39, the third entry at
byte 6D, and so forth). The format for each index line entry is as
follows:
0 - 5 Null bytes, reserved for future use (should all be 00)
6 - 9 Absolute position of card data in file
A Flag byte (00)
B - 32 Index line text
33 Null byte; indicates end of index entry
After the last index entry, each card's data is stored. Card data will
be in one of four general formats: graphic and text, text only,
graphic only, and blank. Blank cards consist of 4 null bytes; the
other card formats are below:
Graphic Text Graphic
& Text Only Only
------ ---- ----
0 - 1 0 - 1# 0 - 1 Length of graphic bitmap #
2 - 3 * 2 - 3 Width of graphic *
4 - 5 * 4 - 5 Height of graphic *
6 - 7 * 6 - 7 X-coordinate of graphic *
8 - 9 * 8 - 9 Y-coordinate of graphic *
A - x * A - x Bitmap of graphic *
x+1 - x+2 2 - 3 x+1 - x+2# Length of text entry #
x+3 - y 4 - z* Text *
x = 9 + length of bitmap
y = x + 2 + length of text entry
z = 3 + length of text entry
# - These bytes are null if no bitmap/text
* - These bytes do not exist if no bitmap/text
The first byte of any card's data entry is pointed to by bytes 6-9 in
the index entry. Note that no null byte is used to indicate the end of
the card's data entry; the next card's data entry immediately follows
the last byte of the previous entry, which will be null only if the
previous card has no text (null length of text entry).
Additional reference words: 3.00