Select a list row from PCA Script
PCA SCRIPT 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.
function select_map() let a = {"guiId":"menu","elementId":"places","property":"selectedId","value":"map"} return action_result("ChangeGUIElementProperty", a)end01. 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.
PCA 3D ADVENTURE STUDIO PCA Script / 357
