FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to protect a prog.-section to be opend twice ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
How to protect a prog.-section to be opend twice ?
Posted: Sun Mar 20, 2016 12:21 PM
Hello,

I have to protect a program-section, to be opend twice in a lan.
For the moment I'm using a INI to detect if the section is in use.
Maybe still another solution ?
It belongs to the section < writing invoices > that can be open only once the same time.
In this section, some new DBF's must be created for calculations and statistics.
Or maybe a possible solution to show the metro-button DISABLED if in use ?



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: How to protect a prog.-section to be opend twice ?
Posted: Sun Mar 20, 2016 12:29 PM

Uwe,

Is this a seperate DBF-file in your program?
If so, maybe you can lock the DBF if you open this, and unlock if you leave it.
For the other users on the LAN you can chech if the file is locked in order To enable/disable this button.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: How to protect a prog.-section to be opend twice ?
Posted: Sun Mar 20, 2016 12:32 PM

Uwe,

You could do a oBtn:Disable() or simple use a WHEN clause

but the Method Paint() of Class TMetroBtn has to be modified to paint it disabled

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to protect a prog.-section to be opend twice ?
Posted: Sun Mar 20, 2016 12:36 PM

Antonio, Mark

thank You very much.
Maybe using a DUMMY.dbf on top of the section.
But I think a Button-disable might be a better solution.
The user can see, that it is impossible to write invoices for the moment.

best regards
Uwe :D

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion