SetFormFieldChoiceSelectedIndices

Form fields

Description

Sets selected Choice-field options from comma-separated zero-based indices and keeps the field value and selection-index state consistent

Indices are validated, sorted and deduplicated, and multiple indices require the MultiSelect flag

Syntax

Delphi

Function SetFormFieldChoiceSelectedIndices(Index: Integer; Const SelectedIndices: WideString): Integer;

Parameters

Index1-based index of a form field whose type is Choice
SelectedIndicesComma-separated zero-based option indices; surrounding whitespace is ignored, duplicates are removed, and an empty string clears the selection. More than one index requires the field MultiSelect flag

Return values

Returns 1 on success or 0 for an invalid field, index list or selection mode