using < and == with objects - InfoPath Dev
in

InfoPath Dev

using < and == with objects

Last post 07-16-2010 02:21 AM by alexia_net. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-15-2010 11:28 PM

    using < and == with objects

    Hi. I am having a problem while using < and == with a global variable. The global variable is:

            //nr de vlanuri atasate unui port
            private object _intNo
            {
                get
                {
                    return (int)FormState["_intNo"];
                }
                set
                {
                    FormState["_intNo"] = value;
                }
            }

     

                objRoot = objXnDoc.SelectSingleNode("/my:ConfPorts/my:txtNo", this.NamespaceManager);
                intNo = objRoot.ValueAsInt;

     

    So in this case it return the value as int. But how do I initialize it as int? 

    When I try to do this

    for (int k = 0; k < _intNo; k++)

    i get these errors

    Operator '<' cannot be applied to operands of type 'int' and 'object' 

     Operator '==' cannot be applied to operands of type 'object' and 'int'   


    That is kind a strange. Could anyone help me out? Thank you.

  • 07-16-2010 02:21 AM In reply to

    Re: using < and == with objects

     Well, instead of Object i writte int and it works. :)

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