in reply to UNPACK help plse
Your data string is:
chr '0' '1' '1' '4' '2' '0' '0'
ord 48 49 49 52 50 48 48
intel word lo lh hl hi lo lh hl ??
Now the A7 template unpacks this string as its ascii characters, just as it was constructed. On the ia-32 architecture native int and native long are both customarily 4 bytes, so you expect i,l to give the same results, as well as I,L, the unsigned variants. If the number is less than 2**31, unsigned, both signed and unsigned give the same results.
Now unpack's repeat count templates give up if the data string is too short to provide all the fields. '0114200' only has enough data for one native int, so that's all you get:
perl -e'print 52*2**24 + 49*2**16 + 49*2**8 + 48,$/;" 875639088
After Compline,
Zaxo
|
|---|