IsSet is a function in the ProBuilder language used to determine if a specific index of an array has been initialized or set within the code. This function is particularly useful for managing arrays where not all elements are guaranteed to be assigned a value. The function returns 1 if the index has been set, and 0 if it has not.
ISSET($MyArray[arrayColumn])
Here, $MyArray represents the name of the array, and Index is the specific index of the array you want to check.
// Set values for some indices
$MyArray[0] = 10
$MyArray[2] = 30
// Check if the indices are set
ISSET($MyArray[0]) // Returns 1
ISSET($MyArray[1]) // Returns 0
ISSET($MyArray[2]) // Returns 1
ISSET($MyArray[3]) // Returns 0
This example demonstrates how IsSet can be used to verify whether specific indices in an array have been assigned values. The function returns 1 for indices 0 and 2 where values were set, and 0 for indices 1 and 3 where no values were assigned.
Understanding and using the IsSet function can significantly enhance the reliability and efficiency of array operations in ProBuilder scripts.