09-10-2003, 01:22 AM
how do i take user input and save a file as that? just wondering
saving files
|
09-10-2003, 01:22 AM
how do i take user input and save a file as that? just wondering
09-10-2003, 01:25 AM
you mean save the file with the file name being the inputed text? or with the data inside
09-10-2003, 01:46 AM
save the file with the inputted text as the filename
09-10-2003, 01:52 AM
OPEN can take a string variable as the filename, like so:
Code: OPEN f$ FOR OUTPUT AS #1
09-10-2003, 01:52 AM
Quote:save the file with the inputted text as the filename Code: INPUT a$ tha opens the file wiith the inputed file name and if it doesn't exist then it makes one
09-10-2003, 04:25 AM
thanks but thats not the exact answer i was looking for
here is an example input a$ open "C:\a$.dat" for input as #1 i am trying to write a file to a specific location with the filename as the inputted text. do you kind of see where i am going with this? thanks
09-10-2003, 04:57 AM
It's basicly there. If you want to add the path and file extension, you need to do it a little differently
Code: INPUT,"Enter the name of the file you want to open", FileName$
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)
For God so loved the world, that He gave His only begotten Son, that whoever believes in Him should not perish, but have eternal life.(John 3:16)
09-10-2003, 05:03 AM
woah. that's cool, didn't know you could do that. spiffy. thanks.
09-10-2003, 05:14 AM
Code: ON ERROR GOSUB carryon I think that'll work, but I don't know all the rules around GOSUB... will that code, without an error, move into the carryon sub?
09-10-2003, 06:13 AM
thanks, i think i got it now
|
« Next Oldest | Next Newest »
|