Pack(object)

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
mr bubbles
Grandmaster Poster
Posts: 120
Joined: Thu Jan 18, 2007 2:34 am

Pack(object)

Post by mr bubbles »

Where would this function be used?

I've just never used it.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Examples of its use can be found in \pol\pkg\systems\merchantnodes\textcmd\admin\grabnodes.src in POL 0.95 Distro. Here is the info from \pol\docs\basicem.html

Pack(object)
Parameters: object An object to pack
Explanation: Packs a variable into POL's packed data string format. Note that object references CANNOT be saved with the world, but may be passed to other running scripts, or with an event.
Return values: A string


And from the basic.em file which gives an example of the returned data:

// Pack and Unpack: convert an object to a storable string form
// Pack( 5 ) returns "i5"
// Unpack( "i5" ) returns 5
// strings, integers, reals, and arrays and dictionaries of these can be packed.
Pack( expr );
Unpack( str );

To be honest I too can't think of a time I ever used them. I know I didn't really answer your question but maybe seeing the info will give you ideas of how and why they are used.
Post Reply