Skip to main content
Version: 2025

SalSafeArray

Namespace: PPJ.Runtime.Com

Assembly: PPJ.Web.50 (5.0.0.0)

Wraps a managed array with SAL-compatible SAFEARRAY creation and typed element access.

public class SalSafeArray : SalFunctionalClass

Dimension numbers are one-based; element indices use the lower bounds assigned when the array is created. Typed access requires the matching SAL element category. Invalid bounds and conversion failures may throw.

Example:

using PPJ.Runtime;
using PPJ.Runtime.Com;

var values = new SalSafeArray(new int[] { 10, 20 });
SalNumber first = 0;
if (values.GetNumber(ref first, 0))
System.Console.WriteLine(first);

Constructors

Instance member SalSafeArray()

Initializes a wrapper without an array.

Instance member SalSafeArray(array)

Wraps the supplied managed array and determines its element type.

NameTypeDescription
arrayArrayThe managed array to wrap, or null.

Properties

Instance member Value

Array: Gets or sets the managed array and updates the associated SAL and automation type codes.

Methods

Instance member Create(vt, elements, lowerBound)

Creates a one-dimensional managed array with the requested automation element type.

ParameterTypeDescription
vtSalNumberThe COM VarEnum code for the array element type.
elementsSalNumberThe element count, or the per-dimension element counts for a multidimensional array.
lowerBoundSalNumberThe first valid index.

Returns: SalBoolean. True if the array is created; false if the automation type is undefined or unsupported.

Instance member Create2D(vt, elements1, elements2, lowerBound1, lowerBound2)

Creates a two-dimensional managed array with the requested automation element type.

ParameterTypeDescription
vtSalNumberThe COM VarEnum code for the array element type.
elements1SalNumberThe first dimension length.
elements2SalNumberThe second dimension length.
lowerBound1SalNumberThe first dimension lower bound.
lowerBound2SalNumberThe second dimension lower bound.

Returns: SalBoolean. True if the array is created; false if the automation type is undefined or unsupported.

Instance member CreateMD(vt, elements, lowerBounds)

Creates a multidimensional managed array with the requested automation element type.

ParameterTypeDescription
vtSalNumberThe COM VarEnum code for the array element type.
elementsSalArray<SalNumber>The element count, or the per-dimension element counts for a multidimensional array.
lowerBoundsSalArray<SalNumber>The lower bound of each dimension, in dimension order.

Returns: SalBoolean. True if the array is created; false if the automation type is undefined or unsupported.

Instance member GetBoolean(value, index)

Reads a boolean value at the specified array indices.

ParameterTypeDescription
value by referenceSalBooleanReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetBoolean2D(value, index1, index2)

Reads a boolean value at the specified array indices.

ParameterTypeDescription
value by referenceSalBooleanReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetBooleanMD(value, indices)

Reads a boolean value at the specified array indices.

ParameterTypeDescription
value by referenceSalBooleanReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetDate(value, index)

Reads a date value at the specified array indices.

ParameterTypeDescription
value by referenceSalDateTimeReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetDate2D(date, index1, index2)

Reads a date value at the specified array indices.

ParameterTypeDescription
date by referenceSalDateTimeReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetDateMD(date, indices)

Reads a date value at the specified array indices.

ParameterTypeDescription
date by referenceSalDateTimeReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetLowerBound()

Gets the lower index of the first dimension.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetLowerBound2D(nDim)

Gets the lower index of the specified dimension.

ParameterTypeDescription
nDimSalNumberThe one-based dimension number.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetLowerBoundMD(nDim)

Gets the lower index of the specified dimension.

ParameterTypeDescription
nDimSalNumberThe one-based dimension number.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetNumber(value, index)

Reads a number value at the specified array indices.

ParameterTypeDescription
value by referenceSalNumberReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetNumber2D(value, index1, index2)

Reads a number value at the specified array indices.

ParameterTypeDescription
value by referenceSalNumberReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetNumberMD(num, indices)

Reads a number value at the specified array indices.

ParameterTypeDescription
num by referenceSalNumberReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetObject(value, index)

Reads a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetObject2D(value, index1, index2)

Reads a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetObjectMD(value, indices)

Reads a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetString(value, index)

Reads a string value at the specified array indices.

ParameterTypeDescription
value by referenceSalStringReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetString2D(value, index1, index2)

Reads a string value at the specified array indices.

ParameterTypeDescription
value by referenceSalStringReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetStringMD(value, indices)

Reads a string value at the specified array indices.

ParameterTypeDescription
value by referenceSalStringReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetUpperBound()

Gets the upper index of the first dimension.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetUpperBound2D(nDim)

Gets the upper index of the specified dimension.

ParameterTypeDescription
nDimSalNumberThe one-based dimension number.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetUpperBoundMD(nDim)

Gets the upper index of the specified dimension.

ParameterTypeDescription
nDimSalNumberThe one-based dimension number.

Returns: SalNumber. The bound, or -1 when no array is attached.

Instance member GetVariant(value, index)

Reads a variant value at the specified array indices.

ParameterTypeDescription
value by referenceSalVariantReceives the element value; an object wrapper is populated in place.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetVariant2D(value, index1, index2)

Reads a variant value at the specified array indices.

ParameterTypeDescription
value by referenceSalVariantReceives the element value; an object wrapper is populated in place.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member GetVariantMD(value, indices)

Reads a variant value at the specified array indices.

ParameterTypeDescription
value by referenceSalVariantReceives the element value; an object wrapper is populated in place.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutBoolean(value, index)

Writes a boolean value at the specified array indices.

ParameterTypeDescription
valueSalBooleanThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutBoolean2D(value, index1, index2)

Writes a boolean value at the specified array indices.

ParameterTypeDescription
valueSalBooleanThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutBooleanMD(value, indices)

Writes a boolean value at the specified array indices.

ParameterTypeDescription
valueSalBooleanThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutDate(value, index)

Writes a date value at the specified array indices.

ParameterTypeDescription
valueSalDateTimeThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutDate2D(value, index1, index2)

Writes a date value at the specified array indices.

ParameterTypeDescription
valueSalDateTimeThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutDateMD(value, indices)

Writes a date value at the specified array indices.

ParameterTypeDescription
valueSalDateTimeThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutNumber(value, index)

Writes a number value at the specified array indices.

ParameterTypeDescription
valueSalNumberThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutNumber2D(value, index1, index2)

Writes a number value at the specified array indices.

ParameterTypeDescription
valueSalNumberThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutNumberMD(value, indices)

Writes a number value at the specified array indices.

ParameterTypeDescription
valueSalNumberThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutObject(value, index)

Writes a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutObject2D(value, index1, index2)

Writes a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutObjectMD(value, indices)

Writes a object value at the specified array indices.

ParameterTypeDescription
valueSalObjectThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutString(value, index)

Writes a string value at the specified array indices.

ParameterTypeDescription
valueSalStringThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutString2D(value, index1, index2)

Writes a string value at the specified array indices.

ParameterTypeDescription
valueSalStringThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutStringMD(value, indices)

Writes a string value at the specified array indices.

ParameterTypeDescription
valueSalStringThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutVariant(value, index)

Writes a variant value at the specified array indices.

ParameterTypeDescription
valueSalVariantThe value to store in the array element.
indexSalNumberThe element index within the array's declared bounds.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutVariant2D(value, index1, index2)

Writes a variant value at the specified array indices.

ParameterTypeDescription
valueSalVariantThe value to store in the array element.
index1SalNumberThe element index in the first dimension.
index2SalNumberThe element index in the second dimension.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.

Instance member PutVariantMD(value, indices)

Writes a variant value at the specified array indices.

ParameterTypeDescription
valueSalVariantThe value to store in the array element.
indicesSalArray<SalNumber>The element index for each dimension, in dimension order.

Returns: SalBoolean. True if the value is transferred; false if no array exists or the element category does not match.