Search Tools Links Login

A way to input / write from/to .txt files_*

This is only for beginners and the advanced guys will know it ..The following lines of code will teach you how to input from .txt files and how to write to .txt files ....
Votes and Comments are highly appreciated !
Happy Programming

Original Author: ComputerWhiz


Make a label and name it lblInput1
Make a .txt file in the same folder as the project .and name it as InputFile
make a command button ,name it cmdWrite
make a textbox and name it txtInput
Now ,in the Form_load() event ,add this code -
dim txtVar1 as string
open app.path + "inputfile.txt" for input as #1
input #1, txtvar1
txtvar1 = lblinput.caption
close #1

Now to write to .txt files
In the cmdwrite_click() event -
open app.path + "inputfile.txt" for append as #2
write #2, txtinput
close #2

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 114 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.