why doesn't my savefile option work?

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
 

petrbury

Member
Licensed User
Longtime 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
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…