PbArray<T>.Item[int index] Property
.NET Standard 2.x
Gets or sets the element at the specified index.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public T this[int index]{get => this.GetValue(index); set => this.SetValue(value, index);}
Property Value
index
The index of the element to get or set.
T
The element at the specified index.
Examples
The following code example demonstrates how to create a one-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 Example1()
{
// Creates a PbArray object
PbArray<int> pbArray = new PbArray<int>(3);
pbArray[0] = 2;
pbArray[1] = 4;
pbArray[2] = 6;
Console.WriteLine(pbArray[0]);
Console.WriteLine(pbArray[1]);
Console.WriteLine(pbArray[2]);
/*This code produces the following output:
2
4
6
*/
}
}
}
Applies to
.NET Standard
2.x