Re: Get Statement Not Retrieving Record Correctly
- From: Ben <bcumminsr@xxxxxxxxx>
- Date: Fri, 21 Sep 2007 11:33:24 -0700
On Sep 21, 10:48 am, dpb <n...@xxxxxxx> wrote:
Ben wrote:
Thanks for ready this post. I am using a Get statement to read an
ascii file. In the data is a value of "1/2" then it appears that the
Get statement ignores the value after the "/". An example of what the
data is and then how Get statement retrieves it...
Data as in the File: "46 1/2 ISLAND"
Get Statement: "46 1/ ISLAND"
Does anyone know a work around to get the full value "1/2"?
Below is the code to open the file.
FF = FreeFile
Open strFileName For Binary As #FF
Do Until EOF(FF) And lbCancel = False
Get #FF, Posn, Rec
Should need no "workaround". There's a problem either in the code not
shown or the contents of the data file or perhaps even in the display of
the result.
As well as the other questions from Jeff and Rick, what does Debug show
the actual contents of the record in question on file contain? That is,
how do you know the data is what you say and _only_ what you say? Given
the symptom that the remainder of the record is read past the apparently
missing "2" and the record seems to display as a character longer than
the data record, I'm guessing the most likely culprit is a multi-byte
non-printing character in the file that may have come from a word
processor or other source wherein the "1/2" was displayed as the single
symbol and converted on save to the written fraction but not correctly
or some similar scenario.
In short, I'll bet the contents of the data file are not the following
hex bytes
34 36 20 31 2F 20 49 ...
but
34 36 20 31 2F xx xx 20 49 ...
--- Hide quoted text -
- Show quoted text -
Viewing the data file in a Hex editor for the values in question "1/2"
the hex value is "31 2f 32"
.
- Follow-Ups:
- References:
- Prev by Date: Re: Move all image file to new directory
- Next by Date: Re: Get Statement Not Retrieving Record Correctly
- Previous by thread: Re: Get Statement Not Retrieving Record Correctly
- Next by thread: Re: Get Statement Not Retrieving Record Correctly
- Index(es):
Relevant Pages
|