Declare a vector public in InfoPath2007 - InfoPath Dev
in

InfoPath Dev

Declare a vector public in InfoPath2007

Last post 06-16-2010 06:52 AM by alexia_net. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-16-2010 05:58 AM

    Declare a vector public in InfoPath2007

    Hi. I am not quite sure how to declare a vector in Infopath 2007 as public. For a variable it would be like this:

             private object _var1
            {
                get
                {
                    return FormState["_var1"];
                }
                set
                {
                    FormState["_var1"] = value;
                }
            }

    But if I have a matrix or vector like _var2[3,3], how do i declare it, and how do I assign values to it? Thank you!

  • 06-16-2010 06:25 AM In reply to

    Re: Declare a vector public in InfoPath2007

    Have you tried

    private object[,] _var1
    {
        get
        {
            return FormState["_var1"] as object[,];
        }

        set
        {
            FormState["_var1"] = value;
        }
    }

    I haven't tried that, but I think it'll work.  You should be able to access it like a regular array, and of course you'll need to initialize it before you start assigning values to its elements:

    _var1 = new object[5, 5];

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-16-2010 06:52 AM In reply to

    Re: Declare a vector public in InfoPath2007

     Hi. This works very nice. Thank you.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.