fmt_unpack [function]
fmt_unpack( string fmt, string data )
unpacks the byte buffer data
using the format fmt
, returns unpacked items (possibly in an array)
- if '#' can be found in the format string, all data is returned in, otherwise
- unpacks c/w/l/q/p to integers, f/d to floats, s to strings
- if signed numbers are expected (as set by the "-" modifier), the sign bit of the expected type is extended to the end of the native integer type, this makes the loaded integer signed
- refer to fmt_pack() for more info about the format
print fmt_unpack( "3ld", fmt_pack( "3ld", 0, 1, 2, 3 ) ); // prints [0,1,2,3]