Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do this, Do that...
Message
De
30/05/1998 09:19:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00102329
Message ID:
00103334
Vues:
28
>> ...My launcher.exe doesn't always detect that the network.exe is more recent than the local.exe though. Would you be willing to shoot me the piece of code that checks for most recent exe? I am interested in what approach you took to compare datetime for exe. BTW - That run command works fine for me also...thanks Josh!
>
>Interesting you should mention the version detection problem :) I had same thing, my launcher would not detect the comparison:
>
>if fdate(server.exe) = fdate(local.exe);
> AND ftime(server.exe) > ftime(local.exe)
> && then do copy
>endif
>

I wrote a function TStamp() which returns the timestamp number from a filename or a date and time (two params... now I have to add the datetime parameter type), in the same format that Fox uses in .scx and other .??x files; it returns a zero if the file doesn't exist. So

if Tstamp(server_exe)>TStamp(local_exe)
etc

made my life much simpler. I've used to check if I have to copy some lookup tables to workstations in a slow network, but it generally saved my day many times. You don't need to write this function at all, you can just make CtoT(dtoc(fdate(server_exe))+" "+ftime(server_exe)) and compare the two datetimes with equal effect. Ah, put that into a function - Fdate() will break if file doesn't exist, so you have to check for it and return {} if it's not there, and then calculate if it is.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform