CArray:Remove

CArray:Set


The Set method adds or changes the value of the member at a specified CArray index.

Syntax

CArray:Set( index, value )

bullet.gif    index is the member index to set, beginning at 1.

bullet.gif    value is the target value to assign to assign.

Example

The following script sets 2 of the CArray members. Other members, such as index 2, remain undefined:

A = new_array()

-- create a CArray

A:Set( 4, 10.5 )

-- set the member at index 4

A:Set( 1, 2.5 )

-- set the member at index 1

Printf("A[4] = %lg", A:Get(4) )

-- result: A[4] = 10.5

Printf("A[2] = %lg", A:Get(2) )

-- result: A[2] = 0

Related Topics

CArray, Init


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.