PbArray<T>.GetValue(int index) Method
.NET Standard 2.x
Gets the value at the specified position in the one-dimensional PbArray.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public T GetValue(int index);
Parameters
index
System.Int32
A 32-bit integer that represents the position of the PbArray element to get.
Returns
T
The value at the specified position in the one-dimensional PbArray.
Examples
The following code example demonstrates how to use the GetValue(int index) method to get values from the specified position in the one-dimensional array. The index is specified as a 32-bit integer.
using System;
using PowerScript.Bridge;
namespace Appeon.ApiDoc.PbArrayExamples
{
public class GetValueExample
{
public void Example1()
{
// Creates a PbArray object and assigns values
PbArray<int> pbArray = new PbArray<int>() { 2, 4, 6};
// Shows the data of pbArray
for (int index = 0; index < pbArray.Length; index++)
{
Console.WriteLine(pbArray.GetValue(index));
}
/*This code produces the following output:
2
4
6
*/
}
}
}
Applies to
.NET Standard
2.x