Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Multidimensional Array problem.

    Help
    2
    5
    218
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • _
      _JKDOS F last edited by _JKDOS

      Maybe I'm just stupid tonight, or maybe I don't know how to use these in Fuze. This errors

      Array myArray[6][26]
      myArray[0][6] = 1
      

      Any index greater than 5 for 2nd dimension fails.

      I suspect I am not doing this right because if Increase the amount of rows, the number of avail columns increases.

      I get the error if the index of my 2nd dimension matches the len() of the first dimension.

      Edit: I am doing this in the game tutorial from help. So the problem is not directly related to the 2d array

      Unrecognized type: 4
      
      1 Reply Last reply Reply Quote 0
      • _
        _JKDOS F last edited by

        Let's try this again. Here is the problem isolated.

        array myArray[6][26]
        
        myArray[0][6] = 1
        
        loop
            clear()
            print( Len( myArray) )
            update()
        repeat
        
        // Result 7
        

        Or

        array myArray[6][26]
        
        myArray[0][25] = 1
        
        loop
            clear()
            print( Len( myArray) )
            update()
        repeat
        
        // Result 26
        
        sys64738 1 Reply Last reply Reply Quote 0
        • sys64738
          sys64738 F @_JKDOS last edited by sys64738

          @_JKDOS len is bugged on multi dimensions. It returns the len of the wrong dimension. I'll edit this in a sec if there was as work around.

          I believe you can specify the first dimension with

          len(arrayname[0]) 
          
          //Instead of doing 
          
          len(arrayname[0][0])
          
          //Until the bug is fixed
          
          1 Reply Last reply Reply Quote 0
          • sys64738
            sys64738 F last edited by sys64738

            Sorry to double post. Not figured out how to end the code insert.

            As for the other stuff. Might be another bug. Just been learning these myself and had troubles

            1 Reply Last reply Reply Quote 0
            • _
              _JKDOS F last edited by _JKDOS

              I wasn't able to find a work around. If using Len() for something like for loops, I have to hard code the lengths in.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post