Paradox Community

Items in pnews.paradox-programming

Subject:Re: Capture Server Time ?
Date:Wed, 7 Feb 2024 22:09:33 -0800
From:Peter <>
Good idea, I'll try the textstream tomorrow.

The code is in a library. Every form opens that particular library. If 
nothing is happening then the lock file's timestamp will not be updated. 
I have to be sure that the calling form is getting a current time stamp, 
hence the tcursor lock to trigger the lck file's timestamp update.

Thanks Liz

On 02/07/2024 09:29 p.m., Liz McGuire wrote:
> You could try a textstream type and see if that's any faster.  Just read 
> the time off the txt file rather than the lock file.  But if all 
> instances are updating the same files, couldn't you just read the lock 
> file without the tcursor?  Guess I'm not sure what exactly is going on...
> Liz
> On 07 Feb 2024 13:07, Peter wrote:
>> 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.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 twenty 
>> passes.
>> 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