how to interpret the  symbol

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Justin Carter

    #1

    how to interpret the  symbol

    Hi. I'm using VB6 and trying to read in a simple text file. I'm
    using a statement similar to the following, which generally works
    fine.

    Input #Item, variable1, variable2, variable3, etc.

    The problem is that one of the strings that is read in, variable2 in
    the above example, is a square symbol, . An error is thrown, and I
    can't find a way to work around it. (I'm stuck reading in that
    symbol, i.e. I can't just change it in the text files, which would
    solve the problem.)

    I've tried using an ErrorHandler and Resume Next, but that symbol
    seems to mess up the whole row of input, so I can't break up the above
    statement into several Input statements and read the line variable by
    variable using several Input statements like the following:
    Input #Item variable1
    Input #Item variable2
    ....

    I don't know how VB interprets the  symbol, and so can't figure out a
    way around it. I'd really appreciate any help. Thanks.

    Justin
  • J French

    #2
    Re: how to interpret the  symbol

    The  symbol stands for anything that cannot normally be diplayed

    You need to examine a file with something like a Hex Editor to find
    out what it is.

    Also better use Line Input and break the line yourself

    On 12 Aug 2003 07:56:21 -0700, VBgoogle@hotmai l.com (Justin Carter)
    wrote:
    [color=blue]
    >Hi. I'm using VB6 and trying to read in a simple text file. I'm
    >using a statement similar to the following, which generally works
    >fine.
    >
    >Input #Item, variable1, variable2, variable3, etc.
    >
    >The problem is that one of the strings that is read in, variable2 in
    >the above example, is a square symbol, . An error is thrown, and I
    >can't find a way to work around it. (I'm stuck reading in that
    >symbol, i.e. I can't just change it in the text files, which would
    >solve the problem.)
    >
    >I've tried using an ErrorHandler and Resume Next, but that symbol
    >seems to mess up the whole row of input, so I can't break up the above
    >statement into several Input statements and read the line variable by
    >variable using several Input statements like the following:
    >Input #Item variable1
    >Input #Item variable2
    >...
    >
    >I don't know how VB interprets the  symbol, and so can't figure out a
    >way around it. I'd really appreciate any help. Thanks.
    >
    >Justin[/color]

    Comment

    • CajunCoiler \(http://www.cajuncoiler.tk\)

      #3
      Re: how to interpret the  symbol

      I have a hex dump utility that would work nicely in this
      situation. It's available from my download page at...



      "J French" <erewhon@nowher e.com> wrote in message[color=blue]
      > You need to examine a file with something like a Hex Editor to find
      > out what it is.[/color]



      Comment

      • Raoul Watson

        #4
        Re: how to interpret the  symbol


        "Justin Carter" <VBgoogle@hotma il.com> wrote in message
        news:c2ec143c.0 308121058.351c2 e20@posting.goo gle.com...[color=blue]
        > A follow-up, since I noticed the square symbol didn't show up - at
        > least when I look at it now. (It showed up in the preview before I
        > posted.) If you want to see the symbol I'm talking about, it's in
        > line 15 at the following site:
        > http://www.nrhatrc.org/r+d/cdd2.txt
        >[/color]

        Hi Justin..

        Next time something like this happen, there is a quick easy trick. I do
        debug <filename> and then do "D" for display memory. When I do that I get:

        0B0A:0360 0A 22 43 4F 44 45 53 55-42 22 2C 31 35 2C 22 1A .CODESUB,15,.
        0B0A:0370 22 2C 37 2C 22 44 22 2C-22 44 22 2C 37 30 34 2C ,7,D,D,704,

        After the 15 and comma there is a hex "1A" or "26" decimal. This is the
        right arrow symbol in terminal font, or the end of file marker, or Ctrl-Z.

        Should not cause a problem, just read it with Line Input statement and get
        it one character at a time.


        Comment

        • Justin Carter

          #5
          Re: how to interpret the symbol

          Thanks to everyone for their help. I tried several of the
          suggestions, and a combination of those plus one other change did the
          trick. I used the hexdump utility referenced, also found that the
          problem was "1A," and had planned to use a LOF (instead of EOF), use a
          file pointer to get the last position before the 1A was read, and then
          if the location was less than the LOF, go back and continue reading
          until the position = LOF. However "Line Input" would not read past
          that point. I found if I opened the file
          For Binary As #Item
          the problem was solved. It read the 1A symbol just fine. The
          original code opened the file
          For Input Access Read As #Item

          So thanks again for the suggestions.
          Justin

          "Raoul Watson" <WatsonR@Intell igenCIA.com> wrote in message news:<4xA_a.851 0$u%2.1949@nwrd ny02.gnilink.ne t>...[color=blue]
          > "Justin Carter" <VBgoogle@hotma il.com> wrote in message
          > news:c2ec143c.0 308121058.351c2 e20@posting.goo gle.com...[color=green]
          > > A follow-up, since I noticed the square symbol didn't show up - at
          > > least when I look at it now. (It showed up in the preview before I
          > > posted.) If you want to see the symbol I'm talking about, it's in
          > > line 15 at the following site:
          > > http://www.nrhatrc.org/r+d/cdd2.txt
          > >[/color]
          >
          > Hi Justin..
          >
          > Next time something like this happen, there is a quick easy trick. I do
          > debug <filename> and then do "D" for display memory. When I do that I get:
          >
          > 0B0A:0360 0A 22 43 4F 44 45 53 55-42 22 2C 31 35 2C 22 1A .CODESUB,15,.
          > 0B0A:0370 22 2C 37 2C 22 44 22 2C-22 44 22 2C 37 30 34 2C ,7,D,D,704,
          >
          > After the 15 and comma there is a hex "1A" or "26" decimal. This is the
          > right arrow symbol in terminal font, or the end of file marker, or Ctrl-Z.
          >
          > Should not cause a problem, just read it with Line Input statement and get
          > it one character at a time.[/color]

          Comment

          Working...