FromField 1

Description:

FromField method derives a size from the value in a field that has already been processed. Three parameters are used, the first two being required. The first parameter is the unit, that is one of the terms listed for the Fixed method ("Bits", "Bytes", etc.). The second is the name of the field that contains the size. The optional third parameter is an adjustment, a (possibly negative) integer that is subtracted from the field value.

Suppose the field "data_count" contains the value 6. (FromField Words data_count 1) would extract the value 6, subtract 1, multiply by 16 (remember all Size methods return the length in bits), and return the result 80.

Parameters:

[Required]

List

"Units"


List values:

Bit

Bits

Times

Nibble

Nibbles

Byte

Bytes

Octet

Octets

Word

Words

Dword

Dwords

Qword

Qwords

[Required]

Field

"Which field"


[Optional]

Int

"Offset (in units)"

(Default value: 0)

Example:

FIELD var_id (FromField Bytes var_len) (StringOfAscii 20) IN_SUMMARY ID 50 ID