Files
five/_FiveSql2/test/debug_open.prg
Charles KWON OhJun 486e466592 feat: FiveSql2 43/43, @byref, mutable closure, RTL 479, DateTime fix
Major changes since last commit:
- FiveSql2 SQL:1999 engine (10,458 LOC) — 43/43 ALL PASS
- 21 compiler/runtime bugs fixed (short-circuit AND/OR, FOR LOOP, etc.)
- @byref pass-by-reference via RefCell pattern
- Mutable closure capture (EnsureLocalRef + RefCell sharing)
- RTL: 400 → 479 functions (+79: file, string, datetime, hash, UTF-8)
- DateTime/Timestamp fully working (hb_DateTime, hb_Hour/Min/Sec, display)
- Reserved word guard (39 keywords blocked from function calls)
- AEval arg order fix (element before index)
- Closure capture redecl fix (unique _cap_ names per block)
- Hash/string indexing in ArrayPush/ArrayPop
- Harbour compat test suite: 51/51
- 4 docs: Porting Report, Implementation Plan, Optimization Plan, Commercialization

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:35:37 +09:00

53 lines
1.1 KiB
Plaintext

#include "FiveSqlDef.ch"
#include "hbclass.ch"
FUNCTION Main()
LOCAL nWA, cFileLow, aFiles, cRDD
dbCreate("dbg_test", { {"ID","N",4,0}, {"NAME","C",20,0} })
USE "dbg_test" NEW EXCLUSIVE
APPEND BLANK
REPLACE ID WITH 1, NAME WITH "Alice"
CLOSE ALL
? "=== Trace OpenTable steps ==="
cFileLow := "dbg_test"
? "Step 1: hb_FileExists"
? " .fsv:", hb_FileExists(cFileLow + ".fsv")
? "Step 2: Directory"
BEGIN SEQUENCE
aFiles := Directory(cFileLow + "*.cdx")
? " CDX files:", Len(aFiles)
RECOVER
? " Directory() FAILED — using empty"
aFiles := {}
END SEQUENCE
IF Len(aFiles) > 0
cRDD := "DBFCDX"
ELSE
cRDD := "DBFNTX"
ENDIF
? " RDD:", cRDD
? "Step 3: dbUseArea"
BEGIN SEQUENCE
dbUseArea(.T., cRDD, cFileLow + ".dbf", "TEST01", .T., .T.)
? " Opened OK"
nWA := Select("TEST01")
? " nWA:", nWA
IF nWA > 0
dbSelectArea(nWA)
? " FCount:", FCount(), "RecCount:", RecCount()
ENDIF
dbCloseArea()
RECOVER
? " dbUseArea FAILED"
END SEQUENCE
FErase("dbg_test.dbf")
? "=== DONE ==="
RETURN NIL