Managed DBF using X# language

This forum is meant for anything you would like to share with other visitors
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Managed DBF using X# language

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Managed DBF using X# language

Post 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
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Managed DBF using X# language

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
DexterZ
Posts: 28
Joined: Sat Dec 03, 2016 1:35 am

Managed DBF using X# language

Post by DexterZ »

Hello Cris,


I wil try it immediately many thanks ^_^y

Dexter Z
User avatar
DexterZ
Posts: 28
Joined: Sat Dec 03, 2016 1:35 am

Managed DBF using X# language

Post by DexterZ »

Hello WolfGang,

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

Dexter Z
User avatar
DexterZ
Posts: 28
Joined: Sat Dec 03, 2016 1:35 am

Managed DBF using X# language

Post 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
Post Reply