|
-
Nov 12th, 2001, 08:16 PM
#1
multiple txtboxes saving to file
How can I do this.
I have 4 text boxes side by side, and I want to save all of their
contents to a file. But I want the file's contents to reflect how
they look in the text boxes side by side. What I mean is I can't
save the first text box and then the second, third, etc., but I need
to get line #1 from textbox1, textbox2, textbox3, & textbox4 and
that will be the first line of the text file......
How can I do this in a loop??
Thanks for any help.
-
Nov 12th, 2001, 08:19 PM
#2
PowerPoster
VB Code:
Print #1, Text1.Text & " " & Text2.Text & " " & Text3.Text etc etc...
-
Nov 12th, 2001, 08:24 PM
#3
Fanatic Member
if you're saving settings, you can also use the registry.
here's some code
VB Code:
Private Sub Command1_Click()
Call WriteToFile (text1.Text & " " & text2.text & " " & text3.text & _
" " & text4.text & vbcrlf, app.path & "\filename.txt")
End Sub
'write to file sub
Public Sub WriteToFile(strLineToWrite As String, strFileName As String)
'write log file will make dir if it doesnt exists
Dim FileNum As Integer 'Windows File Number Reference
Open strPath & "\" & strFileName For Append As FileNum
'If it is there then append data to end of file
Print #FileNum, strLineToWrite
Close FileNum
Exit Sub
End Sub
Last edited by nabeels786; Nov 12th, 2001 at 08:27 PM.
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|