forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


file date and time
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Nov 24, 2002 12:11 am    Post subject: :( Reply with quote

lol well i was close


so if i follow you right save the time and date the file was made then compare it to????? ( i thought i follow you here)
humm i can't compare it to the current time cuase like you said that will always be later....
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Nov 24, 2002 12:25 am    Post subject: Reply with quote

Compare the saved file time value to
the current file time value...
__________________________________________________________________________________________________________________________
Code:

LIST CREATE, 1

if @file(c:\whatever.txt)
   LIST LOADFILE, 1, c:\whatever.txt
else
   LIST ADD, 1, @file(c:\test\test.txt, T)
   LIST SAVEFILE,  1, c:\whatever.txt
end

if @greater(@file(c:\test\test.txt, T), @item(1,0))
   INFO FILE HAS CHANGED!
else
   INFO Same old file...
end

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Nov 24, 2002 5:06 pm    Post subject: hummmm Reply with quote

well mac i tried that code above and it still don't work right Sad


hummmmm

EDIT- never my i think i see what is going on.....
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Nov 24, 2002 5:12 pm    Post subject: Reply with quote

You do realize ya have to run it at least twice
to have something to compare...

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Nov 24, 2002 5:44 pm    Post subject: yea Reply with quote

yea that is what i found out.

hummm that might be a problem...will have to play with it
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Nov 24, 2002 5:50 pm    Post subject: Reply with quote

It shouldn't be a problem...

You don't have to run it twice every time,
just the first time to start a record file...

Actually it makes the record file the very first time,
it just has no new info to compare that first time.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Sun Nov 24, 2002 6:24 pm    Post subject: ahhhhh Reply with quote

ahhh k i see what you are saying


thanks


i'am going to play with it to see what i can mess up....lol

thanks again
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Tue Nov 26, 2002 4:07 am    Post subject: hummm Reply with quote

well i have been playing with it and its still does not work right....

ok do this make a file called test then run that program, then edit that test file added more to it...save it then run that code even if you run it twice it will say file "file has changed" even tho the file is 5 mins old.....meaning you made the NEW file at 10:50 and nows its 10:55 it should say "same old file"




i hope i explain this right
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Nov 26, 2002 7:12 pm    Post subject: Reply with quote

Isn't it easier if you use the @ask() function to ask the user for input??? Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Nov 26, 2002 9:37 pm    Post subject: Reply with quote

Tim, the code above works perfectly.

Here's another example (using the same code as
above with less confusing filenames hopefully). I
added code to update the record file as needed
(sorry, I thought you understood what we're doing
here...). Check that your filenames are correct.

Create a file c:\test.txt, run this code, edit
c:\test.txt and run this code again. It works.

Code:

if @file(c:\record.txt)
   LIST LOADFILE, 1, c:\record.txt
else
   LIST ADD, 1, @file(c:\test.txt, T)
   LIST SAVEFILE,  1, c:\record.txt
end

rem -- Here's a visual check --
INFO @file(c:\test.txt, T)@cr()@cr()@item(1,0)

if @greater(@file(c:\test.txt, T), @item(1,0))
   INFO FILE HAS CHANGED!
   LIST CLEAR, 1
   LIST ADD, 1, @file(c:\test.txt, T)
   LIST SAVEFILE,  1, c:\record.txt
else
   INFO Same old file...
end

Cheers, Mac

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Nov 27, 2002 12:27 am    Post subject: hummm Reply with quote

yea i thought i was following it to. but the old code does do that. ( at least for me it does).I haven't tried the "new" code you posted yet ( i will in a hour or so)



thanks
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Nov 27, 2002 12:49 am    Post subject: Reply with quote

The other example was showing how to do the
comparison.

I had already mentioned updating the record
file when the file time/date changes, so I just
assumed you'd add code to do that... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Wed Nov 27, 2002 1:08 am    Post subject: oohhhhhh Reply with quote

ohhhh i see what you are talking about....no i didn't added that....sorry about that i guess i thought it was all in there and i didn't look at the code closes enough like i should have.

also i will test the new code i HOPE tonight yet Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group