Results 1 to 3 of 3

Thread: Arrays in Structs....???

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    7

    Arrow Arrays in Structs....???

    Hello im having a problem with making an array in a struct. If i put
    public struct HWND_ARR
    {
    public bool is_ACTIVE;
    public string [] COMMAND_LIST_NEW ;
    }
    that works but.... when i try HWN_ARRAY[1].COMMAND_LIST_NEW[1] . it gives me a error becuase i have not set the arry but if i put public string []command_list_new = new string[100] it wont work cas u cant have a "=" in a struct it says somting about a bad token.. so how is it done .... any 1?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Try this, might work for you:


    HWND_ARR[] HWN_ARRAY = new HWND_ARR[2];
    HWN_ARRAY[1].COMMAND_LIST_NEW = new string[100];
    HWN_ARRAY[1].COMMAND_LIST_NEW[1] = "blah";

  3. #3
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Re: Arrays in Structs....???

    Originally posted by proxypro
    Hello im having a problem with making an array in a struct. If i put
    public struct HWND_ARR
    {
    public bool is_ACTIVE;
    public string [] COMMAND_LIST_NEW ;
    }
    that works but.... when i try HWN_ARRAY[1].COMMAND_LIST_NEW[1] . it gives me a error becuase i have not set the arry but if i put public string []command_list_new = new string[100] it wont work cas u cant have a "=" in a struct it says somting about a bad token.. so how is it done .... any 1?
    if you need to put arrays in structs, u shouldnt be using structs
    u should be using classes.

    my 2 cents.

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