Results 1 to 3 of 3

Thread: [RESOLVED] Prob with saving the data from more controls - CommonDialog

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Resolved [RESOLVED] Prob with saving the data from more controls - CommonDialog

    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

    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)
    Following is a sub to write – here's a wrong. I don't know, what?

    Code:
    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
    Please help me, thanks in advance
    Last edited by Tamgovb; Nov 12th, 2008 at 05:26 PM.
    I know, I know, my English is bad, sorry .....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width