PbArray<T>.Item[int index1, int index2] Property
.NET Standard 2.x
Gets or sets the element at the specified two-dimensional array.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public T this[int index1, int index2]{get => this.GetValue(index1, index2); set => this.SetValue(value, index1, index2);}
Property Value
index1
The index of the first dimension of PbArray element.
index2
The index of the second dimension of PbArray element.
T
The element at the specified index.
Examples
The following code example demonstrates how to create a two-dimensional array and set and get the value of the array.
using System;
using PowerScript.Bridge;
namespace Appeon.ApiDoc.PbArrayExamples
{
public class ItemExample
{
public void Example2()
{
// Creates a PbArray object which is a 2*2 two-dimensional array
PbArray<string> pbArray = new PbArray<string>(2, 2);
pbArray[0, 0] = "one";
pbArray[0, 1] = "two";
pbArray[1, 0] = "three";
pbArray[1, 1] = "four";
Console.WriteLine(pbArray[0, 0]);
Console.WriteLine(pbArray[0, 1]);
Console.WriteLine(pbArray[1, 0]);
Console.WriteLine(pbArray[1, 1]);
/*This code produces the following output:
one
two
three
four
*/
}
}
}
Applies to
.NET Standard
2.x