Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Read From Text File
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TheXploder




PostPosted: Fri Feb 04, 2005 8:36 pm   Post subject: Read From Text File

I got this part but I don't know how to make it take something out of the file:

code:

Dim Map(1 To 10, 1 To 10) As Integer

Private Sub Command1_Click()
    Open "D:\visual projects\2005\array.txt" For Input As 1
        Print #1, Text1.Text
    Close 1
End Sub


I'm guessing that there should be another function instead of print.
Sponsor
Sponsor
Sponsor
sponsor
Brightguy




PostPosted: Fri Feb 04, 2005 11:49 pm   Post subject: Re: Read From Text File

You can use the Line Input statement to read text from a file. It reads all text until a newline.
code:
Line Input #1, strText
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: