Windows Vista Forums

Extract data out of a seemingly complex structure

  1. #1


    Curious Guest

    Extract data out of a seemingly complex structure

    I define a variable ("result") as object. Its value is set by
    following code:

    object result = splusObject.GetType().InvokeMember("ReturnValue",
    System.Reflection.BindingFlags.GetProperty, null, splusObject, null);

    Then both bad news and good news. Bad is that "result" seems to be a
    matrix. In my debugger, it is:

    Dimensions:[1..2, 1..2]}
    [1, 1] 112

    Good news is that it contains the correct value I want, "112".

    I've tried to extract "112" out of result, but to no avail.

    Any advice on how to extract "112" out of this complex structure of
    result? Thanks!




      My System SpecsSystem Spec

  2. #2


    Stanimir Stoyanov Guest

    Re: Extract data out of a seemingly complex structure

    Judging from the debugger output, 'result' is a jagged array. If you are
    sure that the result is always a jagged array the following code will let
    you extract the value at [1, 1]. Make sure there are enough elements in the
    matrix though, in order to avoid receiving a IndexOutOfRangeException.

    int[,] b = (int[,])result;
    int resultValue = b[1, 1];

    --
    Stanimir Stoyanov
    http://stoyanoff.info

    "Curious" <fir5tsight@xxxxxx> wrote in message
    news:3494ebbd-ceb9-4887-a0f5-bcc221d0c5bd@xxxxxx

    >I define a variable ("result") as object. Its value is set by
    > following code:
    >
    > object result = splusObject.GetType().InvokeMember("ReturnValue",
    > System.Reflection.BindingFlags.GetProperty, null, splusObject, null);
    >
    > Then both bad news and good news. Bad is that "result" seems to be a
    > matrix. In my debugger, it is:
    >
    > Dimensions:[1..2, 1..2]}
    > [1, 1] 112
    >
    > Good news is that it contains the correct value I want, "112".
    >
    > I've tried to extract "112" out of result, but to no avail.
    >
    > Any advice on how to extract "112" out of this complex structure of
    > result? Thanks!
    >
    >
    >

      My System SpecsSystem Spec

  3. #3


    Curious Guest

    Re: Extract data out of a seemingly complex structure

    Thanks Stanimir! It works.

      My System SpecsSystem Spec

Extract data out of a seemingly complex structure

Similar Threads
Thread Forum
VB 2005 Windows forms Data Structure
When I load a form, I sometimes need to read a table from SQL and "hold" information for lookup during that form's session. I have tried data tables...
.NET General
Script to extract XML data
Hi This script below connects to a weather RSS feed, what I would like to do is extract the text value for each <title> element within the...
VB Script
Zip extract is empty directory structure
Hi I use Vista Ultimate x64 and am having problems with the build in zip extract. I tried multiple zip files from different sources, and these...
Vista file management
batch job to extract data from tables in DB2
I have got a requirement as follows. I am having a table RCBL_ERROR in a database in DB2. I need to create a batch file, which has to extract...
.NET General
Extract data from web page
We have internal web pages that query databases & produce tables based upon certain selections, and then gives an option to view a comma delimited...
PowerShell
Complex Data Structures
I've been looking for a little while today but I haven't been able to find any documentation on complex data structures with Powershell. What I'm...
PowerShell
The easiest way to create an empty data structure
I have discovered how to create an empty data structure very easily and yet effectively. ----- 8< ----- # I guess this way is standard and...
PowerShell