why doesn't my savefile option work?

Discussion in 'Questions (Windows Mobile)' started by Stellaferox, Jun 15, 2007.

  1. Stellaferox

    Stellaferox Active Member Licensed User

    Hi guys,

    I have the following lines in code with y textbox.text full of data. When trying to save this I get an access denied error. Any idea?

    Sub mnuFileSave_Click
    Savedialog.Filter = "Text files (*.txt)|*.txt"
    if fName = "" then
    Choice = savedialog.Show
    if Choice = cCancel then return
    else
    fName = Savedialog.File end if
    fileopen (F,fName,cWrite) s = txtbxData.Text
    filewrite (F,s)
    fileclose (F)
    End Sub
     
  2. petrbury

    petrbury Member Licensed User

    Hi, try this :

    Savedialog.Filter = "Text files (*.txt)|*.txt"
    if fName = "" then
    savedialog.Show
    fname = savedialog.file
    if fname = cCancel then return
    end if
    fileopen (F,fName,cWrite)
    s = txtbxData.Text
    filewrite (F,s)
    fileclose (F)
    End Sub

    It should work.

    Petr
     
  3. Stellaferox

    Stellaferox Active Member Licensed User

    thnx, works great now!
    Marc
     
Loading...