Forum Discussion

yanbear99_11376's avatar
yanbear99_11376
Icon for Nimbostratus rankNimbostratus
Oct 22, 2009

Help! scan ??

Help! I really do not understand it and want to master to give a detailed explanation. Thanks!

 

 

c

 

The data is turned into count 8-bit signed integers and stored in the corresponding variable as a list. If count is *, then all of the remaining bytes in string will be scanned. If count is omitted, then one 8-bit integer will be scanned. For example,

 

binary scan \x07\x86\x05 c2c* var1 var2

 

will return 2 with 7 -122 stored in var1 and 5 stored in var2. Note that the integers returned are signed, but they can be converted to unsigned 8-bit quantities using an expression like:

 

set num [expr { $num & 0xff }]

 

 

You can give me an example and explain the "cc19a *" What is the format?
No RepliesBe the first to reply