ChangeCurrentElement

List command

Syntax

Makes the element at a given position the current one. It is another name for SelectElement().

ChangeCurrentElement(<list>(), <position>)

Parts

<list>A list declared with NewList, written with its empty parentheses: scores().
<position>The position, from 0 to ListSize() - 1. Decimals are dropped.

Returns

1 when the position exists, 0 otherwise. On 0, the current element does not change.

Good to know

  • Coming from PureBasic: the second argument is a position, not an element pointer. aukimi has no element pointers. To come back to an element whose position may change, use PushListPosition() and PopListPosition().

Example

NewList a.integer()FOR k = 1 TO 3  AddElement(a())  a() = k * 10NEXTChangeCurrentElement(a(), 2)Console(Str(a()))   ' 30
In the manual : Arrays, lists and maps