Len

Returns the absolute value of a number

Method Signature

Len(value=[any])

Arguments

Argument
Type
Required
Description
Default

value

any

true

The number to return the absolute value of

Examples

Using structCount as a function

Pass a structure as an argument to the function.

Run Example

user = { 
	ID : 1,
	FIRSTNAME : "Han",
	LASTNAME : "Solo",
	MOVIE : "Star Wars"
};
writeDump( structCount( user ) );

Result: 4

Using structCount as a Member Function

Having a reference of a structure as a variable, use the dot notation to get a key count on it using a member function.

Run Example

user = { 
	ID : 1,
	FIRSTNAME : "Han",
	LASTNAME : "Solo",
	MOVIE : "Star Wars"
};
writeDump( user.count() );

Result: 4

Additional Examples

Run Example

animals = { 
	COW : "moo",
	PIG : "oink"
};
animalCount = animals.count();
echo( "There are " & animalCount & " animal(s) in the 'animals' struct" );

Run Example

animals = { 
	COW : "moo",
	PIG : "oink"
};
animalCount = StructCount( animals );
echo( "There are " & animalCount & " animal(s) in the 'animals' struct" );

Last updated

Was this helpful?