Hi All
I have something like this – how see, I use CommonDialog control. I don’t know how I fix it.
How I would it to make?
This is a sub to read – here's OK, need only procedure of handling any errors
Following is a sub to write – here's a wrong. I don't know, what?Code:Option Explicit Dim strBufor As String Dim strKatalog As String Dim strPlikZapis As String Dim strPlikOdczyt As String Dim intNumPlik As Integer Dim IntLic As Integer Private Sub cmdOdczyt_Click() Dim data() As String With cdlMyDialog .CancelError = True .InitDir = strKatalog .Flags = cdlOFNHideReadOnly .fileName = "" .Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*" .ShowOpen strPlikOdczyt = .fileName End With intNumPlik = FreeFile Open strPlikOdczyt For Binary Access Read As #intNumPlik '<<< open the file strBufor = Input$(LOF(intNumPlik), intNumPlik) Close #intNumPlik data = Split(strBufor, vbNewLine) '<<< get the data For IntLic = 0 To 6 txtRaz(IntLic) = data(IntLic) '<<< entry to determine of objects Next Combo1.Text = data(7)
Please help me, thanks in advanceCode:Private Sub cmdZapis_Click() With cdlMyDialog .CancelError = True .InitDir = strKatalog .Flags = cdlOFNOverwritePrompt + cdlOFNPathMustExist .fileName = "" .Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*" .ShowSave strPlikZapis = .fileName End With intNumPlik = FreeFile Open strPlikZapis For Binary Access Write As #intNumPlik For IntLic = 0 To 6 '<<< And here it's this prob Put #intNumPlik, , CStr(txtRaz(IntLic)) '<<< try it so, unfortunately it to give a one the line, ' <<< still is a wrongly Next '<<< What is a wrong ???? How to make? Put #intNumPlik, , strBufor Close #intNumPlik




Reply With Quote