Martin Wynne
Admin
- Location
- West of the Severn UK
- Info
@nickomThat's a shame; we somehow need to clone you.
Hi Nick,
What do you need to know? Users of Templot don't need to know the internal structure of a BOX file.
But if you do want to know it is all in the code files.
See the save_box() function in keep_select.pas which I uploaded earlier, and the declarations in bgkeeps_unit.pas which
Code:
function save_box(this_one, which_ones, rolling_backup:integer; save_str:string):boolean;
// new file format including text 17-2-00. (v:0.48 on).
// newer file format including unlimited shoves in StringList 1-5-01 (v:0.71.a on).
// this_one = if which_ones=-1, save only this index (echo, etc.)
// which_ones = -1 = this_one index only, 0=all templates 1=bgnd templates only 2=unused only 3=selected group only 4=library only 234a: 5=selected group are brick templates
// rolling_backup = 0=normal save, 1=running backup, -1=final backup on exit.
// save_str = if not '', is the path and file name to use, so don't ask him. (0.76.a 20-5-02).
// The 071 file format is the same as the 048 format with the addition of "Data Blocks" at the end of the file.
// To create the 048 format the shove timber data is duplicated in the template data record (first 30 shoved timbers only).
// The Data Blocks section commences with a byte containing an underscore character '_',
// Then 7 more bytes containing '85A_|.x' , where x is the version build letter (ASCII single-byte characters).
// Then a 16-byte starter record containing the version info and 12 bytes of zeroes (spares):
// Tblock_start=record
// version_number:integer; // the Templot version number.
// zero1:integer; // 12 spares (zero)...
// zero2:integer;
// zero3:integer;
// end;
// Each DATA BLOCK comprises:
// 16 byte Tblock_ident comprising...
// 4 bytes = length of data segment x.
// 4 bytes = template index count.
// 4 bytes = code indicating content of block. 10 = shoved timbers, 20 = symbols
// 4 bytes = spare - set to zero.
// then x bytes = data segment.
// DATA BLOCKS are repeated until the END BLOCK, which comprises
// 16 byte Tblock_ident comprising all zeroes (segment length=0).
I will explain it all when I release a few more files. I explained it once before, but there have been quite a few changes since.
cheers,
Martin.
message ref: 11291