Working with data returned as a Complex Array

jrobinson6274

Please bear with me if my terminology is incorrect.

I'm attempting to extract data from an object. The object has a complex array which consist of rows and 6 columns per row.

I need to access the very last row in the array so I'm using .Count. The problem is a can't access the columns within the row. Here is the code:

           var weight = USBHIDDRIVER.USBInterface.usbBuffer;
           var cnt = weight.Count;
           Debug.WriteLine(weight[cnt][4]);

USBHIDDRIVER.USBInterface.usbBuffer; contains data in the following format:

ROW [0] - COL [0] = 3
          COL [1] = 4
          COL [2] = 3
          COL [3] = 255
          COL [4] = 6
          COL [5] = 0
Row [1] - COL [0] = 3
          COL [1] = 4
          COL [2] = 3
          COL [3] = 255
          COL [4] = 6
          COL [5] = 0

etc, etc. Thanks in advance.

Peter Hommel

Because accessing a zero based List here, so you should be indexing the last field of the array using Count - 1.

USBHIDDRIVER.USBInterface.usbBuffer is an ArrayList, so it's elements are of type object. To have access to the elements of type byte[] that were added to this list, you will have to typecast the elements to byte[]:

Debug.WriteLine(((byte[])weight[cnt-1])[4]);

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Unable to change text font in for loop with data from a returned array in Swift

分類Dev

LIMIT not working on complex query

分類Dev

Merge complex multidimensionnal array

分類Dev

PHP variable not returned in array

分類Dev

Binding ngModel to complex data

分類Dev

Reaching a data returned by ReactJS

分類Dev

javascript not able to sort complex array

分類Dev

GSON deserialize an array of complex objects

分類Dev

Fitting data with a complex function in python

分類Dev

AJAX form submission - No data returned

分類Dev

c++ method chaining on returned value not working

分類Dev

Converting a complex vector to a sparse diagonal array in Julia

分類Dev

Complex JSON Web Token Array in webapi with OWIN

分類Dev

Only one item being returned from array

分類Dev

Large array returned from scipy integrate quad

分類Dev

Retrieve complex nested data from firebase

分類Dev

Fetch complex format data in list with dart language

分類Dev

SQL Server 2008 Pivot, no Aggregation, complex data

分類Dev

import complex data structure in hive with custom separators

分類Dev

Replace text occurrences with data returned by Promises

分類Dev

Weekly Data is not Returned using Between in SQLite

分類Dev

Display data returned by function in PHP MySQL

分類Dev

Get multiple regex expressions working together to match complex set of strings

分類Dev

API Call not working on TypeScript if only one object is returned

分類Dev

Convert a simple Array to complex Object with items as child array

分類Dev

How to get unique an array of objects back from a complex an array of objects?

分類Dev

JavaScript array push not working

分類Dev

Array Reverse is not working for me ...

分類Dev

Autocomplete not working with array of values

Related 関連記事

  1. 1

    Unable to change text font in for loop with data from a returned array in Swift

  2. 2

    LIMIT not working on complex query

  3. 3

    Merge complex multidimensionnal array

  4. 4

    PHP variable not returned in array

  5. 5

    Binding ngModel to complex data

  6. 6

    Reaching a data returned by ReactJS

  7. 7

    javascript not able to sort complex array

  8. 8

    GSON deserialize an array of complex objects

  9. 9

    Fitting data with a complex function in python

  10. 10

    AJAX form submission - No data returned

  11. 11

    c++ method chaining on returned value not working

  12. 12

    Converting a complex vector to a sparse diagonal array in Julia

  13. 13

    Complex JSON Web Token Array in webapi with OWIN

  14. 14

    Only one item being returned from array

  15. 15

    Large array returned from scipy integrate quad

  16. 16

    Retrieve complex nested data from firebase

  17. 17

    Fetch complex format data in list with dart language

  18. 18

    SQL Server 2008 Pivot, no Aggregation, complex data

  19. 19

    import complex data structure in hive with custom separators

  20. 20

    Replace text occurrences with data returned by Promises

  21. 21

    Weekly Data is not Returned using Between in SQLite

  22. 22

    Display data returned by function in PHP MySQL

  23. 23

    Get multiple regex expressions working together to match complex set of strings

  24. 24

    API Call not working on TypeScript if only one object is returned

  25. 25

    Convert a simple Array to complex Object with items as child array

  26. 26

    How to get unique an array of objects back from a complex an array of objects?

  27. 27

    JavaScript array push not working

  28. 28

    Array Reverse is not working for me ...

  29. 29

    Autocomplete not working with array of values

ホットタグ

アーカイブ