PbArray<T>.GetValue(int index1, int index2) Method
.NET Standard 2.x
Gets the value at the specified position in the two-dimensional PbArray.
Namespace: PowerScript.Bridge
Assembly: PowerScript.Bridge.dll
Syntax
public T GetValue(int index1, int index2);
Parameters
index1
System.Int32
A 32-bit integer that represents the first-dimension index of the PbArray element to get.
index2
System.Int32
A 32-bit integer that represents the second-dimension index of the PbArray element to get.
Returns
T
The value at the specified position in the two-dimensional PbArray.
Examples
The following code example demonstrates how to use the GetValue(int index1, int index2) method to get values from the specified position in the two-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 Example2()
{
// Creates a PbArray object which is a 2x2 two-dimensional array
PbArray<string> pbArray = new PbArray<string>(2, 2) ;
pbArray.SetValue("one", 0, 0);
pbArray.SetValue("two", 0, 1);
pbArray.SetValue("three", 1, 0);
pbArray.SetValue("four", 1, 1);
// Shows the data of pbArray
Console.WriteLine(pbArray.GetValue(0, 0));
Console.WriteLine(pbArray.GetValue(0, 1));
Console.WriteLine(pbArray.GetValue(1, 0));
Console.WriteLine(pbArray.GetValue(1, 1));
/*This code produces the following output:
one
two
three
four
*/
}
}
}
Applies to
.NET Standard
2.x