Results 1 to 5 of 5

Thread: struct trouble

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    39

    Exclamation struct trouble

    i need some help to resolve an error in the code below.

    VB Code:
    1. public struct Domains
    2.     {
    3.         public string id;
    4.         public int start;
    5.         public int length;
    6.         public domainType type;
    7.         public string value;
    8.     }
    9.  
    10. Domains domain1;
    11. ...some code..
    12.  
    13. [U]domain1 =0;[/U]
    14. [U][B]ERROR: Cannot implicitly convert type 'int' to 'TPT.Configurator.BillOfKitsDesign.ConfiguredKits'[/B][/U]


    the underlined code is the region with error and the error message is highlighted immediately below the code in bold underlined. I am new to C# and any help would be immensely appreciated.

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: struct trouble

    What are you trying to do here domain1 is a structure:
    domain1 =0;

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    39

    Re: struct trouble

    i dont quite know, this code is not mine and i'm trying to debug some old code. I'm not able to figure out what the code
    VB Code:
    1. domain1 = 0;

    is supposed to mean!! Thats the reason why i thought posting it here might help. Any clues?

  4. #4
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: struct trouble

    I'd remove it. It is possible that it is an attempt to set domain1 to a default value but to do that you would have to have something like:
    Code:
    domain1.id = "";
    domain1.start = 0;
    //etc

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    39

    Resolved Re: struct trouble

    i was thinking on those lines too...thx for the help buddy. I appreciate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width