- 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>
111 lines
3.6 KiB
C++
111 lines
3.6 KiB
C++
// BDE - (C) Copyright 1995 by Borland International
|
|
|
|
// navigate.c
|
|
#include "snipit.h"
|
|
|
|
static const char szTblName[] = "customer";
|
|
static const char szTblType[] = szPARADOX;
|
|
|
|
//========================================================================
|
|
// Function:
|
|
// Navigate();
|
|
//
|
|
// Description:
|
|
// This sample code will open the Customer table and
|
|
// navigate through it, doing operations such as getting and
|
|
// displaying the current record, getting the next record,
|
|
// getting the previous record, and getting the record relative
|
|
// to the offset given.
|
|
//========================================================================
|
|
void
|
|
Navigate (void)
|
|
{
|
|
DBIResult rslt; // Return value from IDAPI functions
|
|
hDBIDb hDb; // Handle to the database
|
|
hDBICur hCur; // Handle to the table
|
|
|
|
Screen("*** Cursor Navigation Example ***\r\n");
|
|
|
|
BREAK_IN_DEBUGGER();
|
|
|
|
Screen(" Initializing IDAPI...");
|
|
if (InitAndConnect(&hDb) != DBIERR_NONE)
|
|
{
|
|
Screen("\r\n*** End of Example ***");
|
|
return;
|
|
}
|
|
|
|
Screen(" Setting the database directory...");
|
|
rslt = DbiSetDirectory(hDb, (pCHAR) szTblDirectory);
|
|
ChkRslt(rslt, "SetDirectorry");
|
|
|
|
Screen(" Opening the %s table...", szTblName);
|
|
rslt = DbiOpenTable(hDb, (pCHAR) szTblName, (pCHAR) szTblType,
|
|
NULL, NULL, NULL, dbiREADWRITE, dbiOPENSHARED,
|
|
xltFIELD, FALSE, NULL, &hCur);
|
|
if (ChkRslt(rslt, "OpenTable") != DBIERR_NONE)
|
|
{
|
|
CloseDbAndExit(&hDb);
|
|
Screen("\r\n*** End of Example ***");
|
|
return;
|
|
}
|
|
|
|
Screen(" Display the first ten records in the table...");
|
|
DisplayInMemoryTable(hCur, 10);
|
|
|
|
Screen("\r\n Set the current record to the first record in the"
|
|
" table...");
|
|
rslt = DbiSetToBegin(hCur);
|
|
ChkRslt(rslt, "SetToBegin");
|
|
|
|
// We need to display the next record as we are currently at the
|
|
// BOF crack.
|
|
DisplayNextRecord(hCur);
|
|
|
|
Screen("\r\n Change to the next record...");
|
|
rslt = DbiGetNextRecord(hCur, dbiNOLOCK, NULL, 0);
|
|
ChkRslt(rslt, "GetNextRecord");
|
|
|
|
Screen(" New current record:");
|
|
DisplayCurrentRecord(hCur);
|
|
|
|
// Skip 3 records. We will be passing the function a NULL
|
|
// record buffer as we only want to skip and we don't want to fill
|
|
// a record buffer.
|
|
Screen("\r\n Getting the third record relative to the current"
|
|
" record...\r\n New current record:");
|
|
|
|
rslt = DbiGetRelativeRecord(hCur, 3, dbiNOLOCK, NULL, 0);
|
|
ChkRslt(rslt, "GetRelativeRecord");
|
|
DisplayCurrentRecord(hCur);
|
|
|
|
|
|
Screen("\r\n Set the cursor to the previous record...");
|
|
Screen(" New current record:");
|
|
|
|
rslt = DbiGetPriorRecord(hCur, dbiNOLOCK, NULL, 0);
|
|
ChkRslt(rslt, "GetPriorRecord");
|
|
DisplayCurrentRecord(hCur);
|
|
|
|
Screen("\r\n Set the current record to the last record in the"
|
|
" table...");
|
|
Screen(" New current record:");
|
|
|
|
// Set the cursors current record pointer to EOF.
|
|
rslt = DbiSetToEnd(hCur);
|
|
ChkRslt(rslt, "SetToEnd");
|
|
|
|
// Set the cursors to the last record in the table.
|
|
rslt = DbiGetRelativeRecord(hCur, -1, dbiNOLOCK, NULL, 0);
|
|
ChkRslt(rslt, "GetRelativeRecord");
|
|
|
|
DisplayCurrentRecord(hCur);
|
|
|
|
Screen("\r\n Close the database and exit IDAPI...");
|
|
CloseDbAndExit(&hDb);
|
|
|
|
Screen("\r\n*** End of Example ***");
|
|
}
|
|
|
|
|