Help generate maxscript sequent report

MyLog = "c:\\MyBitmapCollector.log"
ini_file = createFile MyLog
ToMyLog = openFile MyLog mode:"at"
 
Sep = "//============================================\\\\"
format "%\n" sep to:ToMyLog
 
txt = ""
format "%\n" txt to:ToMyLog
 
txt = "Total Scene Bitmap : " + (g as string) +" Files"
format "%\n" txt to:ToMyLog
 
txt = "Total Collected Bitmap : " + (u as string) +" Files"
format "%\n" txt to:ToMyLog
 
txt = "Total Missing Bitmap : " + (h as string) + " Files"
format "%\n" txt to:ToMyLog
 
txt = "________________________________________"
format "%\n" txt to:ToMyLog
 
 
if ((u=g) ==true )then txtLog= "All file copied without fail" else txtLog= "Theres still missing bitmap that still not copied"
format "%\n" txtLog to:ToMyLog
 
txt = ""
format "%\n" txt to:ToMyLog
 
Sep = "\\\\============================================//"
format "%\n" sep to:ToMyLog
close ini_file

Hi everybody, I need help to create sequential report for my script, basicly I already made script, like those above, but it didnt generate sequent report, like I wanted. From script above if you execute it, it should create file c:\\MyBitmapCollector.log and contain report like this in it :

(THIS IS DATA REPORT THAT ALREADY EXIST)

//============================================\\

Total Scene Bitmap : 3 Files
Total Collected Bitmap : 1 Files
Total Missing Bitmap : 2 Files
________________________________________
Theres still missing bitmap that still not copied

\\============================================//

but after execute it again, instead of append new report in my log, it just flush all data in my log. How do I append into below the data report that currently exist in my log ?

Big Thanks
fajar

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fajar's picture

as expected from

as expected from anubis...

thanks anubis

Anubis's picture

Hey Fajar, As you need to

Hey Fajar,
As you need to append then create your file just once. Here is...

MyLog = "c:\\MyBitmapCollector.log"
 
-- create the file once
if not doesFileExist MyLog do (
	ini_file = createFile MyLog
	close ini_file -- !
)
 
-- example sequence
for file in arrFiles do
(
	loadMaxFile file quiet:on
	ToMyLog = openFile MyLog mode:"at"
 
	--// <write2file_code_here>
 
	close ToMyLog -- !
)

my recent MAXScripts RSS (archive here)

Ofer Zelichover's picture

Hi, just delete the line:

Hi,

just delete the line: ini_file = createFile MyLog
createFile always creates a new (empty) file.

Cheers,
o

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.