Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: parse date FileTimeGet
It looks as if I can have problems if the FileYmdHms on the file I'm interested in is executed exactly when the application is trying to close out that message file. The application fails.
So what does FileYmdHms do? Does it actually open the file or lock it? What would be the limitations on access by another program at the same instant? Why does it fail when another program has opened the file? Or does it only fail if the other program has locked the file?
I may have to go back to fixed time delays until we get the 32 bit version of this application. We tried RunWait in various flavors last year when we were setting up this process, and they were not reliable. Does the more recent WinBatch have better Wait functions for running 16 bit apps under 32 bit WinBatch on NT 3.51?
FileTimeGet needs read access to the file to check the time. I'm not sure what version you are running. You might try adding the following code just before you check the time...
while FileExist("youfilenamehere")==2 TimeDelay(2) endwhileor maybe (or maybe in addition to the above):
While 1 Errormode(@off) xxx=FileTimeGet("yourfilenamegoeshere") ErrorMode(@cancel) if xxx!=0 then break TimeDelay(2) endwhile
1125: FileTimeGet: File Not Found fcode=FileTimeCode(ExtDllName)error when I try to compile with WBC 99C.
Now see if the compile works. If it does, hit the Extenders button, choose the extenders you want, and then click OK. The compile should work again.
Day = ItemExtract( 1, TimeDate(), ' ') Date = ItemExtract( 2, TimeDate(), ' ')It works if I have "Sun 29/03/98 12:27:43" but not if I have "Sun 5/04/98 8:14:51" The date became the 3rd item !
I have the same problem with FILETIMEGET. I received today " 9/04/98 12:12"
Any suggestion ?
Use:
TimeYmdHms and FileYmdHms to get STANDARD format date/times that are "machine-able" and can safely be used in computations, ItemExtract, etc etc.
For example:
a=TimeYmdHms() ;;Get the current date and time ;;parse the date out Year=Itemextract(1, a, ":") Month=ItemExtract(2, a, ":") Day=ItemExtract(3, a, ":")
a=TimeDate( ) ;;;datetime has 3 parts to it. To separate them: ParseData(a) ;;;This will separate it into 3 separate parts; param1, param2, param3 Year=ItemExtract(3, param2, "/") Month=ItemExtract(1, param2, "/") Day=ItemExtract(2, param2, "/") ;;;Some days and months may only have one digit. To make sure they have two digits: If StrLen(month) == 1 Then month="0%month%" If StrLen(day) == 1 Then day= "0%day%" ;;;Finally you need to concantenate the parts together. date=StrCat( year, month, day) Pause("Revised Date =", date)
Article ID: W13877
Filename: Parsing a Date and FileTimeGet Issues.txt
File Created: 2011:06:24:08:18:52
Last Updated: 2011:06:24:08:18:52