Files
five/examples/test_rdd_full.prg
Charles KWON OhJun 59568f3301 Five v0.9 — Harbour + Go fusion language
- Compiler: PP → Lexer → Parser → Analyzer → Gengo pipeline
- Parser: 232/236 (98%) Harbour compatibility, registry-based dispatch
- RTL: 351 Harbour-compatible functions
- RDD: DBF/NTX/CDX engines with Rushmore bitmap optimization
- Go Interop: IMPORT + pkg.Func() + obj:Method() with FastPath (15M calls/sec)
- HB_FUNC API: Full Harbour C API compatible Go bridge
- Concurrency: SPAWN/LAUNCH/GOROUTINE, <-, WATCH, PARALLEL FOR, ASYNC/AWAIT
- Extensions: Multi-return, DEFER, Slice, f-string, Nil-safe ?:, CONST
- Macro Compiler: Runtime AST parsing and evaluation
- Debugger: TUI debugger with source display, breakpoints, stepping
- FRB: Native + Pcode dual mode runtime binary
- Tests: 13 packages ALL PASS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:41:50 +09:00

88 lines
1.9 KiB
Plaintext

// RDD Full Test Suite
FUNCTION Main()
LOCAL i, nCount
? "=== Five RDD Full Test ==="
? ""
// Phase 1: Create + Append
? "Phase 1: Create/Append..."
dbCreate("rddtest", {{"ID","N",6,0},{"NAME","C",20,0},{"CITY","C",15,0}})
USE "rddtest"
FOR i := 1 TO 100
APPEND BLANK
FieldPut(1, i)
FieldPut(2, "Name_" + PadL(AllTrim(Str(i)), 3, "0"))
FieldPut(3, "City_" + AllTrim(Str(Mod(i, 5))))
NEXT
? " RecCount:", RecCount()
GO TOP
? " First ID:", FieldGet(1), "Name:", AllTrim(FieldGet(2))
GO BOTTOM
? " Last ID:", FieldGet(1), "Name:", AllTrim(FieldGet(2))
// Phase 2: Navigation
? "Phase 2: Navigation..."
GO TOP
nCount := 0
DO WHILE !Eof()
nCount++
SKIP
ENDDO
? " Forward count:", nCount
GO BOTTOM
SKIP -1
? " Skip -1 from bottom: ID =", FieldGet(1)
// Phase 3: Delete/Recall/Pack
? "Phase 3: Delete/Pack..."
FOR i := 10 TO 20
GO i
DELETE
NEXT
GO 15
? " Rec 15 deleted:", Deleted()
RECALL
? " Rec 15 after recall:", Deleted()
PACK
? " After Pack:", RecCount(), "records"
// Phase 4: Zap
? "Phase 4: Zap..."
ZAP
? " After Zap:", RecCount(), "records"
// Phase 5: Index
? "Phase 5: INDEX ON..."
FOR i := 1 TO 50
APPEND BLANK
FieldPut(1, i)
FieldPut(2, {"Kim","Lee","Park","Choi","Jung","Kang","Cho","Yoon","Jang","Lim"}[Int(Mod(i-1,10))+1])
NEXT
INDEX ON NAME TO rddtest_name
GO TOP
? " First (indexed):", AllTrim(FieldGet(2))
GO BOTTOM
? " Last (indexed):", AllTrim(FieldGet(2))
GO TOP
nCount := 0
DO WHILE !Eof()
nCount++
SKIP
ENDDO
? " Traversal:", nCount
// Phase 6: SEEK
? "Phase 6: SEEK..."
SEEK "Park"
? " SEEK Park: Found=", Found(), "RecNo=", RecNo()
SEEK "Kim"
? " SEEK Kim: Found=", Found(), "RecNo=", RecNo()
SEEK "ZZZZZ"
? " SEEK ZZZZZ: Found=", Found()
USE
? ""
? "=== DONE ==="
RETURN NIL