Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output

Post new topic   Reply to topic
output file
View previous topic :: View next topic  
Author Message
faughnj3
Newbie


Joined: 14 Apr 2004
Posts: 4

PostPosted: Apr 15th, 2004 08:42 AM    Post subject: output file Reply with quote

does anyone know how to create a new txt file, and have the contents of a 2d array printed to that file, and have the file saved to the c: or desktop

any help would be brilliant
thanks

sorry for posting so soon again its just that im really stuck
Back to top
View user's profile Send private message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 15th, 2004 08:55 AM    Post subject: Reply with quote

when you use the 'Open' statement and the file specified doesn't exist, it is created.
you can then use 'Put' to insert text to the file.
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Apr 15th, 2004 09:29 AM    Post subject: Reply with quote

Gilad_r wrote:
you can then use 'Put' to insert text to the file.


When using Put, your inserting raw data. It's a little different than text. It's good for arrays and user defined "Type" variables because you don't have to worry about carriage returns, line feeds, commas or anything else like that. It also provides some low level data security in that all data "put" to a file is in Binary. And not readable by the average "file browser" (like myself Biggrin ) without a prior knowledge of the file structure (record sizes, data types...)
_________________
If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Apr 17th, 2004 08:49 AM    Post subject: Reply with quote

Gilad_r wrote:
when you use the 'Open' statement and the file specified doesn't exist, it is created.


Only if you open in for output. If you open for input you get an error that the file doens't exist Wink
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
RoofRabbit
Regular


Joined: 06 Jul 2005
Posts: 95
Location: Lenoir, NC USA

PostPosted: Jul 6th, 2005 11:25 PM    Post subject: Reply with quote

Don't save files to the desktop. Too many programs put all kinds of garbage on it already.

For reading and writing text files or any other kind of vars to a file, check out some of the example code in the Visual Basic section on my website.
_________________
Website - [link]
Back to top
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Registry & File Input / Output All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic