Skip to main content

SalArray

Namespace: PPJ.Runtime

Assembly: PPJ.Runtime.49 (4.9.0.0)

Dynamic array class. This class replicates SAL dynamic arrays. It must be declared as an inner class of the class that should be used as the type of the elements of the dynamic array.

public class SalArray : IList, ICollection, IEnumerable, IXmlSerializable, ISalType

Properties

Instance memberCount

Int32: Number of array elements

Instance memberDimensions

SalNumber: Returns the number of dimensions.

Instance memberIsDynamic

Boolean: Returns true if the array is dynamic.

Instance memberIsEmpty

Boolean: Returns true if the array is empty.

Instance memberIsMultidimensional

Boolean: Returns true if the array is an MD array.

Instance memberIsSynchronized

Boolean: IsSynchronized

Instance memberItem(indices)

Object: Get/Set functions used to access the array. The implementation classes will call these methods from their indexers.

Instance memberLength

SalNumber: Returns the total number of items in the array. For MD arrays returns the number of items in the first dimension.

Instance memberSyncRoot

Object: SynchRoot

Methods

Instance memberAdd(value)

Appends one item to the array.

ParameterTypeDescription
valueObject

Returns: Int32.

Instance memberAddRange(collection)

Appends the collection of items to the array.

ParameterTypeDescription
collectionIEnumerable

Instance memberAvg()

Returns the average value of all the numbers in an array.

Returns: SalNumber. nAvg

Instance memberClear()

Clears a dynamic array

Instance memberCopyTo(array, index)

CopyTo

ParameterTypeDescription
arrayArray
indexInt32

Instance memberDimCount()

Returns the number of dimensions in an array.

Returns: SalNumber.

Instance memberDimCount(nDim)

ParameterTypeDescription
nDimSalNumber&

Returns: Boolean.

Instance memberFill(value, count)

Fills an array with the specified value.

ParameterTypeDescription
valueObject
countInt32

Returns: Boolean.

Instance memberFind(value, start)

Finds the value in the array. This is allowed only for single-dimension arrays.

ParameterTypeDescription
valueObject
startInt32

Returns: Int32.

Static memberFromNativeArray(array)

Creates a SalArray from a native array. The type is inferred from the array.

ParameterTypeDescription
arrayArrayNative array to convert to a SalArray.

Returns: SalArray.

Static memberFromNativeArray(array, dbType)

Creates a SalArray from a native array of the specified dbType .

ParameterTypeDescription
arrayArrayNative array to convert to a SalArray.
dbTypeDbTypeType of the elements in the source array .

Returns: SalArray.

Instance memberGetArray(capacity)

Returns the wrapped native array and ensures that the requested element is created for dynamic arrays.

ParameterTypeDescription
capacityInt32[]

Returns: Array.

Instance memberGetElementType()

Returns the type of the array elements

Returns: Type.

Instance memberGetEnumerator()

IEnumerator implementation to support the foreach statement.

Returns: IEnumerator.

Instance memberGetLength(dim)

Returns the number of items in the array

ParameterTypeDescription
dimInt32dimension, first = 1

Returns: Int32.

Instance memberGetLowerBound(dim)

Returns the lower bound of the array.

ParameterTypeDescription
dimInt32

Returns: SalNumber.

Instance memberGetLowerBound(dim, lbound)

ParameterTypeDescription
dimInt32
lboundSalNumber&

Returns: Boolean.

Instance memberGetUpperBound(dim)

Returns the upper bound of an array.

ParameterTypeDescription
dimInt32

Returns: SalNumber.

Instance memberGetUpperBound(dim, ubound)

ParameterTypeDescription
dimInt32
uboundSalNumber&

Returns: Boolean.

Instance memberInsert(index)

Inserts an item at the position. This is allowed only for single-dimension arrays.

ParameterTypeDescription
indexInt32

Instance memberMakeDynamic()

Makes the array dynamic.

Instance memberMax()

Returns the maximum value in an array of numbers.

Returns: SalNumber.

Instance memberMin()

Returns the minimum value in an array of numbers.

Returns: SalNumber.

Instance memberQueryBounds(min, max)

ParameterTypeDescription
minSalNumber&
maxSalNumber&

Returns: SalNumber.

Instance memberRemove(index)

Removes the item at the index. This is allowed only for single-dimension arrays.

ParameterTypeDescription
indexInt32

Instance memberReset()

Resets a dynamic array

Instance memberSetBounds(lower, upper)

Sets the lower and upper bound of an array for the first dimension only. NOTE: In SAL this function was named SalSetArrayBounds().

ParameterTypeDescription
lowerInt32
upperInt32

Returns: Boolean.

Instance memberSetLength(dim, length)

Changes the number of items in the array

ParameterTypeDescription
dimInt32dimension, first = 1
lengthInt32

Instance memberSetLowerBound(dim, bound)

Changes the lower bound of the array

ParameterTypeDescription
dimInt32
boundInt32

Returns: Boolean.

Instance memberSetUpperBound(dim, bound)

Sets the upper bound of an array. The first dimension is 1.

ParameterTypeDescription
dimInt32
boundInt32

Returns: Boolean.

Instance memberSort(index, count, comparer)

Sorts the items in the array.

ParameterTypeDescription
indexInt32
countInt32
comparerIComparer

Instance memberSort(comparer)

Sorts the items in the array.

ParameterTypeDescription
comparerIComparer

Instance memberSum()

Returns the sum of the elements in an array of numbers.

Returns: SalNumber.

Instance memberToNativeArray()

Converts to an array of native types.

Returns: Object.

Inherited By

NameDescription
SalArray<T>Dynamic array generic class. This class replicates SAL dynamic arrays. It can be used without being declared as an inner class by using the new generics syntax.

Implements

NameDescription
ISalTypeCommon base interface for Sal types.