Paradox Community

Items in pnews.paradox-programming

Subject:Re: Capture Server Time ?
Date:Wed, 7 Feb 2024 12:10:13 -0800
From:Peter <peterspammenot@whiteknight.email>
Newsgroups:pnews.paradox-programming
Back at this again.
I could not find an api or anything else so I decided to pursue trying 
to use properties of a file on the server. All I need to do is get a 
Date/timestamp for when a transaction is done. Accuracy is not that 
crucial. Here is what I came up with.

method pushButton(var eventInfo Event)
var
    tcu      	tcurosr
    dattim	datetime
    fsy		filesystem
endVar

;//ServerTime.db is dedicated tbl for this method
;//crucial that ServerTime.db is located on the server

tcu.open(":LOBBY:ServerTime")
tcu.lock("read")

;//PdoxUsrs.lck is created when lock created
if fsy.findFirst(":LOBBY:PdoxUsrs.lck") then
    ;//represents datetime of server
    DatTim = fsy.time()
endIf

tcu.unLock("read")
tcu.close()

endMethod

Tested this in rapid-fire using for/endfor loop and writing to array, 
including millisecs. The results show a range of 30ms-50ms for each loop 
and I did twenty loops.

The question, finally, is there anything faster I can do than a record 
lock to trigger a change in PdoxUsrs.lck? Table lock seems to be slower. 
Thank you.


Peter







On 06/09/2022 12:47 p.m., Peter wrote:
> Is it possible to record events using a server's time rather than 
> individual stations? There are two instances, one running an actual MS 
> server, the other peer to peer.
> 
> The stations cannot be synchronized to the server nor the internet so I 
> am running into problems in recording times for certain transactions 
> such as "updated xx minutes ago"
> 
> The only workaround I can think of is to write a file on the 'server' 
> and then reading the timestamp.
> 
> 
> Peter


Copyright © 2004 thedbcommunity.com