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
file input
View previous topic :: View next topic  
Author Message
faughnj3
Newbie


Joined: 14 Apr 2004
Posts: 4

PostPosted: Apr 14th, 2004 11:40 AM    Post subject: file input Reply with quote

i want to set it up on my GUI to navigate the system directories ( i know how to do that) and when i select a txt file, i want its contents to be saved in a string variable "Rawdata".

if anyone could help me it would be great
thanks
Back to top
View user's profile Send private message
Andir
Centurion


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

PostPosted: Apr 14th, 2004 01:59 PM    Post subject: Reply with quote

Please don't post in more than one location. We can view it anywhere you post it.

As for the answer...
Is this file always plain ASCII text? if so:
Code:

fileNamePath = filepath & "\" & filename
rawData = ""
Open fileNamePath For Input As #1
While Not EOF(1)
   Line Input #1, tempData
   rawData = rawData & tempData & vbcrlf
Wend


If your planning on opening very large files, you might want to put in a DoEvents() line in the While loop. This will allow windows to repaint the windows so your program doesn't look locked up, but it slows down execution.
_________________
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
faughnj3
Newbie


Joined: 14 Apr 2004
Posts: 4

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

sorry about that, didnt know.
but thanks for the help it sorted me out
cheers
Back to top
View user's profile Send private message
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