Sign in to follow this  
Followers 0
adik2dmax666

Current date as filename for .txt files

3 posts in this topic

How can i add the current date (@MON & "/" & @MDAY & "/" & @YEAR) to my .txt file's name?

So my file would look something like this ex. minsyst_02/03/2010.txt

I'm still using this code FileWriteLine("minsyst.txt",$test1)

Thanks :D


First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack. -George Carrette[sub]GD Keylogger Creator (never released)[/sub][sub]Garena Autojoin v3.0[/sub]

Share this post


Link to post
Share on other sites



Hi !

try

$FileName = "minsyst_" & @MON & "-" & @MDAY & "-" & @YEAR & ".txt"

;$FileName = "minsyst_" & @YEAR & "-" & @MON & "-" & @MDAY & ".txt"

note that you can't use slashes as separators, and that the commented version will make it easier to sort by date

whim

Share this post


Link to post
Share on other sites

You mustn't use "/" as the delimiter,

try something like:

$dat = (@MON & "-" & @MDAY & "-" & @YEAR)
$file = FileOpen("d:\minsyst_"& $dat &".txt", 1)
FileWrite($file, "whatever")
FileClose($file)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0