UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | Basic Verbs > sizeOf

sizeOf

Syntax sizeOf (value)

Params value can be an object defined as any Frontier datatype.

Action Determines the size of the object supplied in value. The meaning of the return depends on the datatype.

Returns An integer indicating the number of bytes, elements or other units of measure contained in value.

Examples sizeOf ("Hello")

   » 5

The size of a string is its length.

sizeOf ('a')

   » 1

sizeOf ('bool')

   » 4

sizeOf (clock.now ())

   » 4

Objects whose datatype is 'date' always have a size of 4.

sizeOf (true)

   » 2

boolean values always have a size of 2.

sizeOf (examples.funStuff)

   » 6

examples.funStuff is a table, so sizeOf returns the number of items in it.

sizeOf ({1, 3, 5, 7})

   » 4

The size of a list or record value is the number of items in it.

Notes See Chapter 1 of the UserTalk Reference Guide for more detailed information on Frontier datatypes.

The meaning of the value returned by sizeOf can be determined from the discussion of UserTalk datatypes in Chapter 1 of the UserTalk Reference Guide.

See Also typeOf

Prev | Next | Basic Verbs > sizeOf

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