PT
Developer Forums
Register
Login
[Archived] DarkBASIC Professional Discussion
->
Saving a variable into a file name
<
1
>
D
DJ Translogic
Joined:
19th Mar 2007
Location:
Posted:
18th Jun 2007 15:55
Is it possible to create a file with the name taken from a variable?
if it is, how is it done?
the code i am using obviously isnt working because i think i'm doing it all wrong.
+ Code Snippet
for i = 1 to 10 open to write i, "Files\data\userdata\"rnd(999)".sav" close file i next i
Copy
Thanks, Mike
I
IanM
Joined:
11th Sep 2002
Location:
In my moon base
Posted:
18th Jun 2007 15:57
Change this line:
open to write i, "Files\data\userdata\"rnd(999)".sav"
to this:
open to write i, "Files\data\userdata\" + str$(rnd(999)) + ".sav"
D
DJ Translogic
Joined:
19th Mar 2007
Location:
Posted:
18th Jun 2007 19:03
thanks alot ian, i tryed the + variable + once before, but it looks like i forgot to add the str$() code.
Thankga, Mike
Sign In
Username or Email
Password
Login