Re: Parsing large binary data without huge binary scan command




"Alexandre Ferrieux" <alexandre.ferrieux@xxxxxxxxx> wrote in message
news:cbfa958f-2121-4f20-b7d9-caff49e26291@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 28, 2:42 pm, "John Seal" <john_j_s...@xxxxxxxxxxxx> wrote:
Better would be to build a scan string and varlist programmatically
from some external specification as suggested by others.

In fact, that's what I often do. Something along the lines of

set varList {a2 foo a3 bar} ;# or construct it a pair at a time
foreach {spec varName} $varList {
binary scan $data ${spec}a* $varName data
}

My chief goal was to make the OP aware that you could stuff the leftovers
back into the same var.


.