Cold Help System: Programming: ColdC Reference Manual: Functions: Data: size()


INTEGER size([ANY data])

This function is used for sizing data. If no arguments are specified, it will return the size of the current object, including all of the methods and object variable instances defined on it. Otherwise it returns the size of the first argument. Note: specifying an objnum as the argument will return the size of the objnum, not the size of the object it represents!

The number returned represents the size, in bytes, on disk. Because data is packed when written to the disk database, what is returned will not be comparable to runtime memory footprints.

Examples:

size(#1234)
=> 4
size([1, 2, 3, 4])
=> 15
size(#[['key1, 1], ['key2, "test"]])
=> 45
size(<$root, #[['name, "foo"]]>);
=> 37
size()
=> 5822


frob_class() | size() | toerr() | tofloat() | toint() | toliteral() | toobjnum() | tostr() | tosym() | type() | valid() | fromliteral() | frob_value() | frob_handler()


the Cold Dark