Results 1 to 6 of 6

Thread: Deleting quotes

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    8

    Talking

    I am writing a password program for my PC but when I open the text file and put the text (password) in to a string then save a different password it puts quote marks round the new password which means it wont work next time. how can I delete these quote marks or get
    it so it doesn't read them in.

    EG "password"

    Thanks Jon

  2. #2
    Guest
    Use the Replace function.

    Code:
    Dim strPW As String
    strPW = "EG" & Chr(34) & "password" & Chr(34)
    strPW = Replace(strPW, Chr(34), "")

  3. #3
    Guest
    Could you post your password loading and saving code?

    Sunny

  4. #4
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    No idea what you are talking about, but to read between the quotes, you can use Mid:
    Code:
        Dim strPW as String
        strPW = Mid(Password, 2, Len(Password) - 1)

    r0ach™
    Don't forget to rate the post

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    if you are writing to a text file with the Write Command
    it will enclose the string in quotes...if you use the
    Print Command to write it will not.
    Open bla for bla as bla
    Print #bla, mystring
    close bla

    No Quotes..

    another way..if you use vb6 is the replace function.

    Code:
    Private Sub Command1_Click()
        Dim mySting As String
        mystring = """Help me out"""
        MsgBox mystring
        
        mystring = Replace(mystring, """", "")
        MsgBox mystring
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    8

    Thumbs up

    Thanks everyone!
    I swapped the write Statement for print and it worked perfectly.

    sunnyl:

    I'm not exactly sure what you mean but to open the text file and read the text into a string
    I used:

    Open "C:\pass.dat" For Input As #1
    Input #1, password
    Close #1

    and to write the file back to the file:

    Open "Cass.dat" For Output As #2
    Print #2, password
    Close #2

    Hope this helped

    Jon

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