/
ColdC/Functions/
ColdC/Structure/
<head><title>ColdC: Function/Method Reference: size()</title></head>

<body>

<h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: size()</h1>

<hr>

<p>
<font size=+1><i>INTEGER</i> <b>size</b>([<i>ANY <b>data</b></i>])</font>

<p>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
defined on it, and all of the object variables which are set 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!

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

<p>Examples:

<blockquote><pre>
size(#1234)
=> 8

size([1, 2, 3, 4])
=> 40

size(#[['key1, 1], ['key2, "test"]])
=> 276

size(<$root, #[['name, "foo"]]>);
=> 263

size()      <i>(the $string library on the Cold Dark)</i>
=> 22553
</blockquote></pre>

<p><hr size=4><p align=center><i>Last Modified on Feb 29 1996</i>
<br><i>Copyright &copy; 1995, 1996, Brandon Gillespie</i>
</body>