problem with saving a text

Dim pos As String
Dim dosya As Integer
dosya = FreeFile
pos = InputBox("Please enter the destination", "Enet Desitnation", "c:/windows/desktop/")
If pos <> "" Then
Open pos For Output As dosya
Write #dosya, Text1.Text
Close FreeFile
End If

When i run with this code, the saved text file contains nothing. If i try again with same textfile name, vb gives me an error message but the text file contains the information. What is wrong in here. Why it writes in second try.
Second question is, the text is written between quotation marks. How can ı cancel writing quotation marks.
Thanks for your helps.

Comments

  • : Dim pos As String
    : Dim dosya As Integer
    : dosya = FreeFile
    : pos = InputBox("Please enter the destination", "Enet Desitnation", "c:/windows/desktop/")
    : If pos <> "" Then
    : Open pos For Output As dosya
    : Write #dosya, Text1.Text
    : Close FreeFile
    : End If
    :
    : When i run with this code, the saved text file contains nothing. If i try again with same textfile name, vb gives me an error message but the text file contains the information. What is wrong in here. Why it writes in second try.
    : Second question is, the text is written between quotation marks. How can ı cancel writing quotation marks.
    : Thanks for your helps.
    :
    Print #dosya, Text1.Text
    Close dosya
  • : Dim pos As String
    : Dim dosya As Integer
    : dosya = FreeFile
    : pos = InputBox("Please enter the destination", "Enet Desitnation", "c:/windows/desktop/")
    : If pos <> "" Then
    : Open pos For Output As dosya
    : Write #dosya, Text1.Text
    : Close FreeFile
    : End If
    :
    : When i run with this code, the saved text file contains nothing. If i try again with same textfile name, vb gives me an error message but the text file contains the information. What is wrong in here. Why it writes in second try.
    : Second question is, the text is written between quotation marks. How can ı cancel writing quotation marks.
    : Thanks for your helps.
    :
    Hey,

    I can answer your first question:
    If your code is the same as above then your path is invalid (but I don't think that's it!) and you close a FreeFile, not the current file!

    Greets...
    Richard

  • Thanks both of you. I solve my problems with yours help.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories