Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New file
#1
ok i am writeing a program what is basicly a external script creator (for softwear called playerworlds) it will ask then questions and then add there awnser to the script where it belongs

but to cut to the chase i need to create a new file how would i do this?
Reply
#2
correct me if i'm wrong but you just save the file as normal as though it was there
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#3
ohh and a nother question

i want it to come out in plain text will it do it auto maticaly and can i get some examples of what you mean GDM
Reply
#4
sorry a little off topic but, player worlds is not good. sorry again
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#5
To create a new file (like GDM said)
Code:
OPEN filename$ FOR INPUT AS #1
You can use other file access methods to create a new file (BINARY, RANDOM)

To put text into a file: If you've opened up a file for sequential input (as above), you can use this:
Code:
PRINT #1, "Crap you want to put in the file. Line by line"
It will put the string into the file... line by line. Smile
so
Code:
PRINT #1, "Hello world"
PRINT #1, "is far too common for me"
PRINT #1, "to ever use"
would produce a file that looks like this
Code:
Hello world
is far too common for me
to ever use

HTH

~Phydaux
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79][Image: safer.gif][/url]
END OF LINE.
Reply
#6
why not this
Code:
PRINT "HI" + CHR$(13) + "BYE"
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#7
Well... it would be PRINT #1 for a start, and also you need a CHR$(10) and also if the line becomes longer than 256 characters you'll have trouble compiling it. But for short records you are right, it'll work fine.
Reply
#8
yes i was rite

wahoo
url=http://www.spreadfirefox.com/?q=affiliates&id=0&t=79][Image: safer.gif][/url]
Reply
#9
Quote:why not this
Code:
PRINT "HI" + CHR$(13) + "BYE"
Well apart from all the problems Oracle mentioned, you can't stick commands between "HI" and "BYE" if you needed to.
url=http://www.spreadfirefox.com/?q=affiliates&id=60131&t=79][Image: safer.gif][/url]
END OF LINE.
Reply
#10
Quote:To create a new file (like GDM said)
Code:
OPEN filename$ FOR INPUT AS #1
You can use other file access methods to create a new file (BINARY, RANDOM)

I don't think INPUT will work creating a new file:
INPUT: Open file for reading if it exists
OUTPUT: Open new file for output, delete and create new if exists
RANDOM: Open file for input/output, if not exists create null file
BINARY: Open file for input/output, if not exists create null file

When using INPUT and trying to open a non-existing file, you'll get a file not found error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)