[Closed] writing strings into a file
Hi,
Lets say I have this array arr=#(“01”,“02”,“03”,“04”,“05”). Can I somehow write the individual items into the file but not as strings? Eg when I want to write them now I will have
“01”
“02”
“03”
“04”
“05’
and what I want in the file is
01
02
03
04
05
Is this even possible via maxscript?
Actually I’ve noticed this is not the issue of the lines to write, but the writing itselt. Even given the numers are converted to strings
So what if I want to write a file like this:
fn coolFunction = (
print “How cool is that?”
)
EDIT:
I’m talking about filestream values:
print <value> to:<filestream>
format <fmt_string> { <value> } to:<filestream>
are there any other?
Not sure if this is what you are after, but take a look at Escape Characters.
Or do you want it the other way around?
yeah I would need then other way. When you write something into the file it always makes this a string I don’t know why.
Eg print 10 to: my_filestream
prints in “10” not 10. I guess this is not the way to work with mxs.
What I actually need is some kind of installation for my tools. To use most of my tools you need to copy 3 files to startup dirs and I would like to make this automatic. Thats why I had this idea to make the script print them to files.
Other way I think would be to gather all the scripts in one folder and and pack in rar.
Then after download the user would need to run the “installer.ms” which would run “sysInfo.currentdir” and copy needed scripts into “$stdplugs\stdscripts”
Right?
this should write the numbers out correctly…
-- collect your strings
strArray = for s = 1 to 10 collect formattedPrint s format:"02i"
outName = @"C:/formatTest.txt"
outFile = createfile outName
for i in strArray do format "%
" i to:outFile
close outFile
edit outName