UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | Basic Verbs > pack

pack

Syntax pack (value, binaryAddr)

Params value is the object you wish to pack into a binary datatype.

binaryAddr is the address where the binary version of value is to be stored.

Action Packs value into a contiguous byte stream and puts the result into the binary value at binaryAddr.

Returns True

Examples pack (scratchpad, @x)
true // x now contains a packed binary version of the scratchpad table

pack ('a', @x); return (x)
0x61 // ASCII value for the character "a"

Notes The binaryType of the binary value is set to typeOf (value).

For scalar values, the packed binary form is identical to the value created by simple coercion using the binary verb. However, this verb can operate on any datatype, while binary coercion can only be applied to scalar values.

See Also unpack

binary

getBinaryType

Prev | Next | Basic Verbs > pack

Anonymization by Anonymouse.org ~ Adverts
Anonymouse better ad-free, faster and with encryption?
X