ChoiceStatus

elements.ChoiceStatus (Abstract)

Represents the status of a choice selection with special states.

This abstract type encodes choice selection results as integers:

  • Values >= 0: The index of the selected choice
  • Value -1: No selection made yet (pending)
  • Value -2: Selection was canceled

The type can be implicitly converted to Bool (returns true if a valid choice was made), making it convenient for checking if a selection was successful.

Example usage:

var status:ChoiceStatus = showChoiceDialog();
if (status) { // Implicitly checks if a valid choice was made
    trace("Selected option: " + status.index);
} else if (status.canceled) {
    trace("User canceled the selection");
}

Type Conversions

From:

  • [Int](/api-docs/clay-native/Int/)

To:

  • [Int](/api-docs/clay-native/Int/)