- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
137 lines
6.5 KiB
C++
137 lines
6.5 KiB
C++
// BDE - (C) Copyright 1994 by Borland International
|
|
|
|
#include "inventry.h"
|
|
|
|
// Global data
|
|
HINSTANCE hInst;
|
|
HWND hMainWnd;
|
|
HWND hErrorWnd;
|
|
BOOL NewRecMode = FALSE;
|
|
BOOL RangeSet = FALSE;
|
|
WNDPROC _wpOrigWndProc;
|
|
char szNoneOnOrder[] = "None on Order";
|
|
char far szTblDirectory[DBIMAXPATHLEN+1];
|
|
char far szPrivDirectory[DBIMAXPATHLEN+1];
|
|
|
|
const char far szTblName[] = "Inventry" ;
|
|
const char far szTblType[] = szPARADOX;
|
|
|
|
// Fields for the table
|
|
FLDDesc fldDesc[] = {
|
|
{
|
|
1, // Field Number
|
|
"Item_ID", // Field Name
|
|
fldINT16, // Field Type
|
|
fldUNKNOWN, // Field Subype
|
|
1, // Field Size
|
|
0, // Decimal places
|
|
0, // Offset in record
|
|
0, // Length in Bytes
|
|
0, // For Null Bits
|
|
fldvHASCHECKS,// Validiy checks
|
|
fldrREADWRITE // Rights
|
|
}, {
|
|
2, "Building", fldZSTRING, fldUNKNOWN,
|
|
FLDLENGTH, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}, {
|
|
3, "Item", fldZSTRING, fldUNKNOWN,
|
|
FLDLENGTH, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}, {
|
|
4, "In Stock", fldFLOAT, fldUNKNOWN,
|
|
0, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}, {
|
|
5, "Cost", fldFLOAT, fldstMONEY,
|
|
0, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}, {
|
|
6, "Date Ordered", fldDATE, fldUNKNOWN,
|
|
0, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}, {
|
|
7, "Comment", fldBLOB, fldstMEMO,
|
|
20, 0, 0, 0, 0,
|
|
fldvNOCHECKS, fldrREADWRITE
|
|
}
|
|
}; // Array of field descriptors
|
|
|
|
// Validity Check Descriptor - Describes the validity checks. This index
|
|
// is going to be added to the table when the table is created.
|
|
// Note: Beacuse the max value is saved in a string while our example fields
|
|
// are numbers - we need to save the values as the ascii value of our
|
|
// string. In other words the value 3000 needs to fit into the first two
|
|
// bytes of the string (as it is an INT16).
|
|
// To do this we need to use a function called movemem() (you could do it
|
|
// other ways but this is a nice looking workaround). Therefore, we will
|
|
// set the values in the structure as a string and convert it before using
|
|
// it in a function.
|
|
VCHKDesc VchkDesc[] = {
|
|
{ // First field validity check - Required field.
|
|
1, // Field number, this belongs to
|
|
TRUE, // Is a required field
|
|
TRUE, // If True, has min value
|
|
TRUE, // If True, has max value
|
|
FALSE, // If True, has default value
|
|
{ "0" }, // Min Value
|
|
{ "32767" },// Max Value
|
|
{ NULL }, // Default value
|
|
{ NULL }, // Picture string
|
|
lkupNONE, // Lookup/Fill type
|
|
{ NULL }, // Lookup Table name
|
|
}
|
|
};
|
|
|
|
// Indexes used by the table
|
|
IDXDesc idxDesc[] = {
|
|
{
|
|
"Item ID", // Name
|
|
1, // Number
|
|
{ NULL }, // Tag Name ( for dBase only)
|
|
{ NULL }, // Optional Format
|
|
TRUE, // Primary?
|
|
TRUE, // Unique?
|
|
FALSE, // Descending?
|
|
TRUE, // Maintained?
|
|
FALSE, // SubSet?
|
|
FALSE, // Expression index?
|
|
NULL, // for QBE only
|
|
2, // Fields in key
|
|
1, // Length in bytes
|
|
FALSE, // Index out of date?
|
|
0, // Key Type of Expression
|
|
{ 1, 2 }, // Array of field numbers
|
|
{ 0 }, // Key expression
|
|
{ 0 }, // Key Condition
|
|
FALSE, // Case insensitive
|
|
0, // Block size in bytes
|
|
0 // Restructure number
|
|
},
|
|
{
|
|
"In Stock", 2, { NULL }, { NULL }, FALSE, FALSE,
|
|
FALSE, TRUE, FALSE, FALSE, NULL, 2, 1, FALSE, 0,
|
|
{ 4, 1 }, { 0 }, { 0 }, TRUE, 0, 0
|
|
},
|
|
{
|
|
"Item", 3, { NULL }, { NULL }, FALSE, FALSE,
|
|
FALSE, TRUE, FALSE, FALSE, NULL, 1, 1, FALSE,
|
|
0, { 3 }, { 0 }, { 0 }, FALSE, 0, 0 }
|
|
};
|
|
|
|
// This is the array of index descrpitions used for the Index listbox
|
|
const pCHAR IndexList[] = {"Item ID - Primary Index", "In Stock - In stock"
|
|
" and ItemId", "Item - Item Name"};
|
|
|
|
const unsigned uNumFields = sizeof( fldDesc ) / sizeof ( fldDesc[0] ) ;
|
|
|
|
// Number of indexes to be created when the table is created - note
|
|
// that idxDesc is defined globally.
|
|
const unsigned uNumIndexes = sizeof(idxDesc) / sizeof(idxDesc[0]);
|
|
|
|
// The number of validity checks.
|
|
const UINT16 uNumVchks = sizeof(VchkDesc) / sizeof(VchkDesc[0]);
|
|
|
|
const UINT16 uNumRecs = 5; // Number of records to insert
|
|
|