Results 1 to 7 of 7

Thread: Bidimensional array uncontrolled

  1. #1
    Join Date
    May 2011
    Posts
    109

    Bidimensional array uncontrolled

    I am an student at University of California and I love to try out different programming languages as I really love developing them and using it for my personnel use, so here, I am using the real software for creating some simple application but somehow it seems that I am not been able to make then as I am not been able to control the array that I have, used ,I have used an bidimensional array and it seems that I am not been to control it , any help to make it bounded to the code .

  2. #2
    Join Date
    May 2009
    Posts
    543

    Re: Bidimensional array uncontrolled

    In the definition of the class you can write the one dimension of the array as -1 it shall be increased while you are running the code, so just done worry about it , so this is with the first dimension of array after than moving on to the next dimension you can set the same to 5 ,but remember that the second dimension would not change in the runtime as the first one would so be sure it is a valid number , and then create an instance to use this array .

  3. #3
    Join Date
    May 2011
    Posts
    109

    Re: Bidimensional array uncontrolled

    Hey , I just went through your code and here is what I have found ,It firstly appeared that everything was , right as I made the mistake of using the second dimension of array same as the first dimension of array but , later after reading your post , I made the changes and that worked ,for me as the array then stayed grounded for me , but now , I have been facing a new problem; after writing the code of the two dimensioned array I am not been able to set the array property which provides the auto compete feature .

  4. #4
    Join Date
    May 2009
    Posts
    527

    Re: Bidimensional array uncontrolled

    The property that you are trying to use is only valid for using it in the one dimension array, you cannot use the myarray.ubound property in the bidimensional array , so to do that you might need some higher syntax style , here is the syntax :
    Code:
    Class  rowdata
     Property item(4) as string 
    End
    Class classm
    Property rows(-1) as rowdata
    End
    Instance .rows,append new rowdata.

  5. #5
    Join Date
    May 2009
    Posts
    529

    Re: Bidimensional array uncontrolled

    I think I have this here I have made it a point to see that this also works with 2d matrix , I mean it just the same code with a different logic , as the bi-dimensional array can also be called as two dimensional array. Here is what I have made till know I hope it works for you
    dim Row as new Row1
    Code:
      
      dim p,q,r as Integer
      
      for p=1 to 20
        for q=1 to 8
          tempRow.myRow.Append(str(p)+","+str(q)) 
        next q
        for r=0 to tempRow.myRow.Ubound-1  
          redim MyArray.BiMatrix(UBound(myArray.BiMatrix)+1)
          MyArray.BiDiMatrix(k).myRow.append =tempRow.myRow(k)  
        next r
        redim TempRow.myRow(-1
      next p

  6. #6
    Join Date
    May 2009
    Posts
    637

    Re: Bidimensional array uncontrolled

    that is pretty simple mistake that you have made above I mean every new user does that as I too had done the same mistake when I first coded it , but I think everyone can learn something for here mistakes as I have , you just need to remove the = sign in the
    Code:
    redim MyArray.BiMatrix(UBound(myArray.BiMatrix)+1)
    as the error that you have been facing above is most likely to be caused by the object oriented language

  7. #7
    Join Date
    May 2011
    Posts
    109

    Re: Bidimensional array uncontrolled

    After reading all your comment I suppose that I am not the only one who was not been able to code things up , I would rather like to have some special things in So, as you projected, in such a nested objective, the merely way to add a new lower level constituent (myRow) to the item is to add a higher level ingredient (BiDiMatrix) enclose it .Thank you for your help.

Similar Threads

  1. Array of array in PHP
    By cyber-noob in forum Software Development
    Replies: 4
    Last Post: 26-02-2010, 05:13 PM
  2. C# array help
    By Daren in forum Software Development
    Replies: 5
    Last Post: 03-01-2010, 07:12 AM
  3. Assigning an array to an array
    By MACE in forum Software Development
    Replies: 3
    Last Post: 18-11-2009, 05:19 PM
  4. XML to ARRAY
    By Vandam in forum Software Development
    Replies: 3
    Last Post: 29-06-2009, 06:14 PM
  5. Array Functions in PHP
    By SuperXCM in forum Software Development
    Replies: 2
    Last Post: 26-03-2009, 10:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,910,746.28721 seconds with 17 queries