Navigation

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

    Array Index Troubles

    Help
    help error array
    2
    3
    522
    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.
    • Ben 2.0
      Ben 2.0 last edited by

      I am trying to recreate the "board" game electric football. While coding this I ran into an array index issue.
      I believe this problem comes from the for loop inside another for loop that call for the same repetition counts.
      If someone could see the error in my code and maybe help to fix it, it would be appreciated.
      ID: NNHXVRND5K (may still be pending)

      1 Reply Last reply Reply Quote 1
      • Dave
        Dave Fuze Team last edited by

        I think the problem is the global for loop which uses the counter variable "p" (starts on line 62)

        It's a bug in Fuze which we are aware of and which will be addressed - but if you have a For Loop in global scope, the counter variable can cause issues when it is the same name as others later in the program.

        To fix it easily, change every instance of "p" in that For Loop to something else (I tried with "pl" and it was fine), alternatively you could put that whole For Loop into a function of its own so it's not in global scope anymore.

        Apologies for the inconvenience!

        1 Reply Last reply Reply Quote 2
        • Ben 2.0
          Ben 2.0 last edited by

          Alright, I'll give it a go. Thanks for your help

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