| View previous topic :: View next topic |
| Author |
Message |
faughnj3 Newbie
Joined: 14 Apr 2004 Posts: 4
|
Posted: Apr 14th, 2004 11:40 AM Post subject: file input |
|
|
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 |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Apr 14th, 2004 01:59 PM Post subject: |
|
|
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 |
|
faughnj3 Newbie
Joined: 14 Apr 2004 Posts: 4
|
Posted: Apr 15th, 2004 08:13 AM Post subject: |
|
|
sorry about that, didnt know.
but thanks for the help it sorted me out
cheers |
|
| Back to top |
|
|