ezeio2:scriptref:bufdec

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
ezeio2:scriptref:bufdec [2019-06-16 03:03] – [BufDec( buf[], offset, method )] andrehezeio2:scriptref:bufdec [2023-08-18 23:09] andreh
Line 1: Line 1:
-===== Script reference ====== +==== BufDec ====
- +
-==== BufDec( buf[], offset, method ) ====+
  
 Decode a part of a buffer into a scalar Decode a part of a buffer into a scalar
Line 19: Line 17:
 Available methods: Available methods:
 ^ Method ^ Length ^ Type ^ Description ^ ^ Method ^ Length ^ Type ^ Description ^
 +^ BT_INT8 | 8 bit | signed integer | Single octet value |
 +^ BT_UINT8 | 8 bit | unsigned integer | Single octet value |
 ^ BT_INT16 | 16 bit | signed integer | Big endian integer | ^ BT_INT16 | 16 bit | signed integer | Big endian integer |
 ^ BT_UINT16 | 16 bit | unsigned integer | Big endian integer | ^ BT_UINT16 | 16 bit | unsigned integer | Big endian integer |
Line 25: Line 25:
 ^ BT_INT32LE | 32 bit | signed integer | Little endian integer | ^ BT_INT32LE | 32 bit | signed integer | Little endian integer |
 ^ BT_UINT32LE | 32 bit | unsigned integer | Little endian integer | ^ BT_UINT32LE | 32 bit | unsigned integer | Little endian integer |
 +^ BT_INT32BLE | 32 bit | signed integer | Big-Little endian integer |
 +^ BT_UINT32BLE | 32 bit | unsigned integer | Big-Little endian integer |
 +^ BT_INT32LBE | 32 bit | signed integer | Little-Big endian integer |
 +^ BT_UINT32LBE | 32 bit | unsigned integer | Little-Bit endian integer |
 ^ BT_FLOAT | 32 bit | float | IEEE 732 floating point | ^ BT_FLOAT | 32 bit | float | IEEE 732 floating point |
 +^ BT_FLOATLE | 32 bit | float | IEEE 732 floating point little endian |
 +^ BT_FLOAT64 | 64 bit | float | IEEE 732 64-bit floating point (converts to 32 bit float) |
 +^ BT_FLOATLE | 64 bit | float | IEEE 732 64-bit floating point little endian (converts to 32 bit float) |
  
 Also available for decoding bitmaps: Also available for decoding bitmaps:
Line 35: Line 42:
  
 Example: To extract a 3 bit value from bit position 5,6 and 7, use ''%%BT_BITOFS5 | BT_BITMASK3%%'' Example: To extract a 3 bit value from bit position 5,6 and 7, use ''%%BT_BITOFS5 | BT_BITMASK3%%''
 +
 +NOTE: Pawn 'cells' supports only signed 32 bit integer values, and 32 bit float values.
  
 === Return value === === Return value ===
  • ezeio2/scriptref/bufdec.txt
  • Last modified: 2023-08-18 23:50
  • by andreh