469,352 Members | 2,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

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
Jul 17 '05 #1
4 9140
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, VB******@hotmail.com (Justin Carter)
wrote:
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


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

http://members.cox.net/poohbear1961/downloads.htm

"J French" <er*****@nowhere.com> wrote in message
You need to examine a file with something like a Hex Editor to find
out what it is.


Jul 17 '05 #3

"Justin Carter" <VB******@hotmail.com> wrote in message
news:c2**************************@posting.google.c om...
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


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.
Jul 17 '05 #4
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" <Wa*****@IntelligenCIA.com> wrote in message news:<4x*****************@nwrdny02.gnilink.net>...
"Justin Carter" <VB******@hotmail.com> wrote in message
news:c2**************************@posting.google.c om...
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


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.

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Richard | last post: by
reply views Thread by John Graat | last post: by
1 post views Thread by vsp15584 | last post: by
6 posts views Thread by sadegh | last post: by
reply views Thread by Ryan Gaffuri | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.