IntToHandle(integer)
The IntToHandle Lua function converts an integer number into a handle. The integer needs to correlate with an actual handle.
See the Handle topic for more info regarding handles and links to other related functions.
Arguments
Section titled âArgumentsâ- Integer:
The integer that correlates to an objectâs handle.
- Handle:
The returned handle of the object correlates with the integer.
Example
Section titled âExampleâThis example prints the handle integer number for the selected sequence. It also converts the integer back to a handle and uses this to print the name of the sequence:
| Copy CodeLua |
| ``` |
| return function() |
-- Convert the handle of the currently selected sequence to an integerlocal handleInt = HandleToInt(SelectedSequence())-- Print the handle integerPrintf("The handle integer number of the selected sequence: %i", HandleToInt(SelectedSequence()))-- Convter the integer back to a hanndle and use it to get the sequence namePrintf("The name of the selected sequence is: %s", IntToHandle(handleInt).name)end