xsharp.eu • Managed DBF using X# language - Page 2
Page 2 of 2

Managed DBF using X# language

Posted: Tue Feb 13, 2018 4:54 pm
by robert
Dexter,
Dexter Z wrote:[ Apology for the politeness -- can't break the habit :lol: ]
Your news just make my day, can't wait for that release, hopefully it breaks the DBF file size limitation of 2GIG ^_^ Y
We can only break that limit if we use a different locking scheme. We plan to do that but of course for backward compatibility we also need to support the Clipper, VO & FoxPro locking schemes.

Robert

Managed DBF using X# language

Posted: Tue Feb 13, 2018 4:59 pm
by Chris
Hi Dexter,

Here's a #command for USE taken (and slightly modified) from VO:

Code: Select all

#command USE <db>     ;
     [VIA <rdd>]        ;
     [ALIAS <a>]        ;
     [<sh:SHARED>]      ;
     [<ex:EXCLUSIVE>]           ;
     [<ro:READONLY>]            ;
     [<nw:NEW>]         ;
    ;
    => DBUseArea(<.nw.>, <rdd>, <(db)>, <(a)>, iif(<.sh.> .or. <.ex.>, !<.ex.>, FALSE), <.ro.>)
You can copy/paste it in a X# app and use it like this:

Code: Select all

FUNCTION Start() AS VOID
	USE "C:dbfcustomer.dbf" VIA "DBFCDX" ALIAS test
RETURN

FUNCTION DBUseArea(lNew AS LOGIC, cRdd AS STRING, cFileName AS STRING , cAlias AS STRING , lShared AS LOGIC , lReadOnly AS LOGIC) AS LOGIC
	? lNew , cRdd , cFileName , cAlias , lShared , lReadOnly
RETURN TRUE
it translates to a call to DBUseArea(), because that's what VO uses for (non-OOP) dbf access, but you can change it to translate into code calling your classes if you want.

I think all features of the Clipper preprocessor are now supported by X#.

Chris

Managed DBF using X# language

Posted: Tue Feb 13, 2018 5:05 pm
by wriedmann
Hi Chris,

I have now added a (yet to fill) topic on the preprocessor to the wiki <g>.

https://docs.xsharp.it/doku.php?id=preprocessor

Wolfgang

Managed DBF using X# language

Posted: Wed Feb 14, 2018 2:05 am
by DexterZ
Hello Cris,


I wil try it immediately many thanks ^_^y

Dexter Z

Managed DBF using X# language

Posted: Wed Feb 14, 2018 2:05 am
by DexterZ
Hello WolfGang,

#X Dhttps://docs.xsharp.it has been book marked, many thanks ^ _^ y

Dexter Z

Managed DBF using X# language

Posted: Wed Feb 14, 2018 2:13 am
by DexterZ
Hello Robert,

I managed to extend the 2GIG table limitation in Managed Dbf and the TABLE is still compatible to VFP and the locking scheme is still also compatible to VFP and Managed DBF side to side as long as the table size is less than 2GIG both VFP and Managed DBF comply with Locking scheme.

The compatibility will only break if the TABLE is beyond 2GIG and Managed DBf can only use it and others will report it as not a Dbf file.

If you want to take a look on how I did it, the pleasure is mine to prepare a white paper source code and can give it you, both records accessing and locking scheme beyond 2GIG that is still compatible to others using the table with less than 2GIG of file size ^_^y

"This is one main reason IMO others are jumping to different Database in early 2000's+ because the DBF is only bound to 2GIG in file size on most DBFCDX engine"

Dexter Z