# 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](https://try.boxlang.io/?code=eJwrLU4tUrBVqFbg4vR0UbBSMNTh4nTzDAoO8XP0dQXylTwS85SAYj6OCKHg%2FJx8kJivf5gnRKAksUghPLGoWImr1pqrvCizJNWlNLdAQ6G4pKg0ucQ5vzSvREOhFGSVpoKmNRcA4RsgBA%3D%3D)

```java
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](https://try.boxlang.io/?code=eJwrLU4tUrBVqFbg4vR0UbBSMNTh4nTzDAoO8XP0dQXylTwS85SAYj6OCKHg%2FJx8kJivf5gnRKAksUghPLGoWImr1pqrvCizJNWlNLdAQ6EUaLpecn5pXomGpoKmNRcA%2FjQdbQ%3D%3D)

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

```

Result: 4

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxLzMvMTcwpVrBVqFbg4nT2D1ewUlDKzc9X0uHiDPB0B%2FHyM%2FOylbhqrbkSwWqd80vzSoDqIbxivWQQX0PTmis1OSNfQ0EpJCO1KFUhEYiVFNQUkPWoAUUgfI1iTYXMPIWSjFQFdag56grFJUWlySVKCkCjACgrLaE%3D)

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

```

[Run Example](https://try.boxlang.io/?code=eJxLzMvMTcwpVrBVqFbg4nT2D1ewUlDKzc9X0uHiDPB0B%2FHyM%2FOylbhqrbkSwWqd80vzSoDqg0uKSpNLwDwNhUSoMZrWXKnJGfkaCkohGalFqQqJQKykoKaArFUNKALhaxRrKmTmKZRkpCqoQ01QVygGm6sEMgoAisowGA%3D%3D)

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

```

## Related

* [ArrayLen](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/arraylen)
* [GetMetaData](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/getmetadata)
* [NullValue](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/nullvalue)
* [StringLen](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/stringlen)
* [StructCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/structcount)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/type/len.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
