|
CArray:Exists
The Exists method returns true if a
CArray member exists with the specified indices.
Syntax
|
bSuccess = CArray:Exists( index )
|
index is the index of the member to test.
If the member
is initialized, this method returns true.
If not
initialized, false is returned.
Remarks
If you use
Init then the first n members are set and this function will return
true if tested with an index in range. Otherwise, members
are not initialized if you do not
Set them or if you
Remove them.
Example
The following script tests whether the array member
at index [2] has been initialized:
|
A = new_array()
|
|
|
A:Set( 1, 0.112 )
|
|
|
A:Set( 2, 5.5 )
|
|
|
if A:Exists(6) then
|
|
|
s = "yes" else s = "no"
end
|
|
|
Printf("A[6] exists= %s",
s )
|
|
Related Topics
CArray
Count
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|