Skip to reading
BASIC Scripting

Select a list row from BASIC

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
BASIC PROGRAMMING                                                                               0.86.4.1  /  HOTFIX 1

CHECKED SCRIPTING CALL

A List Box has a registered text property called selectedId. Use the row’s ID when a script needs to highlight a particular choice. The same shared action is callable from all four PCA scripting languages.

Code example
OPTION PCA3D BASIC 1.0
Code example
FUNCTION SelectMap()
Code example
    DIM a = {"guiId":"menu","elementId":"places","property":"selectedId","value":"map"}
Code example
    RETURN ActionResult("ChangeGUIElementProperty", a)
Code example
END FUNCTION

01. Point the call at your own list

Open the GUI in the Runner. For this example its ID is menu, the List Box ID is places, and a row has the ID map. Use a single-selection list with no selectedId binding for this direct write. Substitute your own three IDs if needed.

02. Read the reply

Call the function from an existing script event. Inspect ok and, on failure, error and message. The correct row should highlight. If the target is unavailable, check that the GUI exists, the element ID is correct and you supplied its owning GUI ID.

03. Let a binding own its value

If the list selection is bound to a variable, edit that variable instead. A checked direct write can return bound_property. A width write to a responsive managed or anchored control can return layout_owned; edit the container or the element’s layout constraints.

CURRENT REFERENCE

Validate Action and Property Reference includes 244 action and graph entries, 219 script-callable entries and 709 registered property entries. The property appendix in this edition was rebuilt from the 0.86.4.1 catalog.

BASIC / 86

Page 86 of 86Permalink
Go to page