Auto-increment logging filename


inddyn

Recommended Posts

Probably the easiest way is with the registry. Lets assume you have some script to start the logging set:

beginlogging(mylog)

In front of that script put:

private lognum = registry.lognum

lognum++

registry.lognum = lognum

logging.mylog.strFileName = "c:\mydata\data_"+doubletostr(lognum)+".dat"

beginlogging(mylog)

You could technically do this all with just the registry variable I suppose... Note that registry.lognum will default to 0 until you set it to something else.

Note that you can actually change the logging file name without stopping the logging set. The logging set will simply close the current file and open the new file name.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.