Hi,
really ! interesting,
to work without a "workarea".
[ You know what you miss if its gone ... ]
Beforehand an explanation: LetoDB[f] C-API
means an P-rogramming I-nterface for language 'C' -- for LetoDB[f].
It is made not as a separate effort, it is the 'underlaying layer' below the Harbour RDD -- aka below a "workarea".
The RDD methods (mostly) use these functions to communicate with the server.
And this 'C-API' i am using in my tests for a xBase app to work with LetoDBf.
Most obvious consequence is that we can not use 'pure' field-names,
but have to call a function which queries the C-API for the field content.
In the attached example ( test_xpp.prg for xBase !! ) you see these:
g() == fieldGet() -- p() == fieldPut().
In line 54ff we see a classic REPLACE command:
-- that works because of the PP rule in line 5+.
( We may notice, that i can use an ALIAS in the field name )
[ Such PP rule i cannot add generally, as it interfere with other DBEs ]
But there are more consequences: FILTER and RELATIONs
-- they also would need "work-areas" we don't have at client side
-- but fortunately we have real work-areas at server side!.
That means we can set 'optimized' FILTER and RELATION expressions,
which the server can evaluate because they are 'self containing' without
references to a variable of the client.
That is a limitation!, but as we want 'performance' it is the way to go,
because then the client need to know of a FILTER only for academic purpose,
the server will handle all what is needed.
The attached example snippet does not show the actually ~ 1500 lines of wrapper functions
-- aka what is behind a 'LetoRecCount()' etc ... [ yet all done at PRG! level ].
It looks IMO convenient ?
And it only needs 'internally' ! 6 STATIC variables:
two arrays plus two pointer what item in the array is the active one,
plus one STATIC indicating that the system is initialized ...
I thought about OPP style, but it would make much more effort -- a proof for
myself that well designed 'modular' code can be superiour ;-)
---
If xBase have no 'interest' [ or 'capacities' ] to earn money,
so i should make it for free -- but that is a pity, because:
# XPP user are used to PAY, and something free may seem to them worthless
# XPP user are NOT used to build themself system parts
-- and they may get very scared if they can look down into source 8-)
=> maybe i upload it as 'binary' ? 8-)
---
hefty work in progress ...
-- have done a lot changes to the C-API, all still not uploaded ...
stay tuned
elch