# HandleToStr(handle)

Source: https://help.malighting.com/grandMA3/2.4/HTML/lua_objectfree_handletostring.html
This is grandocs, an unofficial mirror of MA Lighting documentation. For authoritative or safety-relevant information, cite the canonical page on help.malighting.com.

---
## Description

The **HandleToStr** Lua function converts a handle into a string in a hexadecimal number format.

See the [Handle topic](/grandma3/2-4/lua_handle/) for more info regarding handles and links to other related functions.

## Arguments

- **Handle**:\
  The handle of the object.

## Return

- **String**:\
  The returned string is the handle number converted to a hexadecimal format.

## Example

This example prints the handle hex number for the selected sequence. It also converts the string back to a handle and uses this to print the name of the sequence:

|                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Copy Code](javascript:void\(0\))Lua                                                                                                                                  |
| ```
return function()
    Printf("The string (in hex format with 'H#' in front) for the handle of the selected sequence: %s",HandleToStr(SelectedSequence()))
end
``` |