binary scan -problem
- From: "Esa Heikkinen" <esa.heikkinen@xxxxxxxx>
- Date: Tue, 27 Sep 2005 12:42:33 +0300
Hi
It is possible that "binary scan" -command does not work correctly ?
I have following code, which reads the binary file:
while { $ret == 4} {
set line [read $CCSfileID 34]
set ret [binary scan $line "ssA8A22" apo_numero yhtio_numero bussi_tunnus
yhtio_nimi ]
if { $ret == 4 } {
incr count
puts "$count apo=$apo_numero yhtio=$yhtio_numero
bussitunnus=$bussi_tunnus yhtionimi=$yhtio_nimi"
} else {
#puts "ret=$ret"
}
}
Sometimes variable $apo_numero is not correct ! I did not find any rule for
this behavior.
For example, if this variable should be 132, it is 30.
Or 137, it is 48.
Or 401, it is 280.
Or 13, it is 10.
(Range of this variable is: 0 - 500.)
I have compared that with the binary editor and the original binary file.
I have tried by TCL 8.0, 8.3 and 8.4.
Has anyone some hints for this problem ?
---
Esa
.
- Follow-Ups:
- Re: binary scan -problem
- From: Uwe Klein
- Re: binary scan -problem
- From: Donald Arseneau
- Re: binary scan -problem
- Prev by Date: TIP #257: Object Orientation for Tcl
- Next by Date: Re: Rendering Unicode diacritics
- Previous by thread: TIP #257: Object Orientation for Tcl
- Next by thread: Re: binary scan -problem
- Index(es):
Relevant Pages
|
|