No, I meant 
fh = fopen( "d:\\newfold\\msdata.txt", "a");
where msdata is a string that is dynamically constructed in
the afl and takes input from Date()

This should prevent overwriting old files.

Joseph Biran
____________________________________________
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Sent: Tuesday, July 01, 2008 2:23 PM
To: [email protected]
Subject: [amibroker] Re: How to write to a file with a
dynamic name including a date

You can use any valid filename that you want.

Assuming that you will be looping through bars, you can just
use the 
Day(), Month(), Year() functions, then construct your file
name using 
the indexed value on a bar by bar basis.

See this library example for reference: 
http://www.amibroker.com/library/detail.php?id=1044&hilite=Y
EAR

You will, of course, have to modify it to suit your needs.
But, the 
concept of iterating through bars and accessing the
individual 
year/month/day is illustrated. Combine this with
fopen/fputs/fgets 
and you should be good to go:

http://www.amibroker.com/guide/afl/afl_view.php?id=225

Mike

--- In [email protected], "J. Biran" <[EMAIL PROTECTED]>
wrote:
>
> 
> Is there a simple way in afl to read / write to a file
which
> name includes the date? 
> i.e. myfile20080701.txt 
> 
> Joseph Biran
> ____________________________________________
>



------------------------------------

Please note that this group is for discussion between users
only.

To get support from AmiBroker please send an e-mail directly
to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check
DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links



Reply via email to