Atypical write to file? – look here
Welcome :wave:
Me again, small question. :rolleyes:
Is this possible? some way is to save in 1 textfile from 3,4 different objects, but in such the way that i can easily and the correctly text load to every with the objects
Or maybe it load them before the call this form?
Thx in advance
Re: Atypical write to file? – look here
I'm not understanding your question.
Are you asking how to save the contents of three different textboxes to the same text file?
Re: Atypical write to file? – look here
Yes exactly, and also it can be e.g. from 2 TextBoxes and 1 ComboBox
I think so, that to sort thing in a file and to mark specified strings some the symbols......it is possible?
Re: Atypical write to file? – look here
Quote:
Originally Posted by Tamgovb
Yes exactly, and also it can be e.g. from 2 TextBoxes and 1 ComboBox
VB Code:
Open "c:\tamgovb.txt" For Append As #1
Print #1, Text1.Text & vbNewLine
Print #1, Text2.Text & vbNewLine
Print #1, Combo1.List(Combo1.ListIndex)
Close #1
Quote:
Originally Posted by Tamgovb
I think so, that to sort thing in a file and to mark specified strings some the symbols......it is possible?
You lost me again. What is it that you want to do?
Re: Atypical write to file? – look here
On moment I will return to your solution. You passed example, it will not be problem with load the data from this file to a textboxes and combobox?
What is it.... so, good questions. Hmm, you will not believe, only i wonder how to make to spare on my work with writing the code. Also with a practical causes - it's more quickly.
Only my knowledge, hmm.......damn (sorry), such poor is, i must get to know much.
back to the theme, or can ask you about some example code - save / read such banal example of code, leaning on this what you wrote already.
Hack, i will be grateful, thx
P.S. AAaaa - really I noticed now - you about it ask, I thought that it is complikated very and now this has not meaning
Re: Atypical write to file? – look here
Quote:
Originally Posted by Hack
Are you asking how to save the contents of three different textboxes to the same text file?
VB Code:
Dim data() As String
'to save the data
Private Sub Command1_Click()
Open App.Path & "\data.txt" For Output As #1 'open file for output
Print #1, Text1.Text 'save text1's text
Print #1, Text2.Text 'save text2's text
Print #1, Text3.Text 'save text3's text
Close #1 'close file
End Sub
' to load the data
Private Sub Command2_Click()
Dim buffer As String
Open App.Path & "\data.txt" For Input As #1 ' open file for input
buffer = Input$(LOF(1), 1) 'load the whole file at once
Close #1 'close file
data = Split(buffer, vbNewLine) 'split the data at every new line
Text1.Text = data(0) 'text1's text is the splited data
Text2.Text = data(1) ' " "
Text3.Text = data(2) ' " "
End Sub
Re: Atypical write to file? – look here
Where are you with this particular issue at the moment?