dcsimg
Results 1 to 6 of 6

Thread: Problem after load

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    63

    Problem after load

    Hi to all

    I use this code
    Code:
                Dim Fi As New System.IO.FileInfo(OpenFileDialog1.FileName)
                Dim File_Path As String = Fi.DirectoryName
                Dim Temp_File_Name As String = Fi.Name
                Dim Dot_Position As Integer = InStr(1, Temp_File_Name, ".")
                File_Name.Text = Mid(Temp_File_Name, 1, Dot_Position - 1)
                Dim FileToCopy As String = File_Path & "\" & Temp_File_Name
                V26_Final.Text = ""
                V26_Final.LoadFile(FileToCopy, RichTextBoxStreamType.PlainText)
                V26_Final.SaveFile(Save_RTF_File, RichTextBoxStreamType.PlainText)
    To open a file dialog select a file and fill a V26_filan rtf file.

    The point is
    the file i use for load is something like this
    ^XA
    ^RS,,,3,N
    ^RR3


    The V26_final (the V26_final is an rtf file) after the read is something like this
    ^XA
    ^RS
    3
    N
    ^RR3

    When they find a "," they delete it and go to the next line.

    WHY????????

    Thanks and regards

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,798

    Re: Problem after load

    1) They're not RTF files... not if you're loading & saving using plain text.
    2) there's nothing in that code that is changing the data, it's loading it, and saving it (which makes me wonder why)
    3) What's actually in the RTB after loading it? Does it look right? Are SURE you're looking at the right file when verifying the save?
    4) Lastly, what's with the load and immediate save? What's the purpose behind that.?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    63

    Re: Problem after load

    First of all thanks for your time.
    The V26_final is a richtextbox in my form.
    nor I can understand why when they find a comma they go to the next line
    This is the first 3 lines from my file.
    After the sub run the V26_final is look like this
    ^XA
    ^RS
    3
    N
    ^RR3

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,798

    Re: Problem after load

    the RTB doesn't do anything like that. So the only thing I can think of is that the file isn't what you think it is. Or there's more to it... I saved the data as a text file, loaded it into an RTB using the same code and it looks fine. It looked exactly as I'd expect it to.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    63

    Re: Problem after load

    Thanks again techgnome.
    Finally the problem is in another place.
    The problem if from the input command.

    How it is possible to read sequential a file that contains comma without change the line.

    Thanks,

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,798

    Re: Problem after load

    How are you reading it now? if you want to read the line, read the line... it sounds like you're actually just reading from it, which is field by field rather than reading the whole line...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width