Navigation

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

    Variable doesn't exist even though it does

    Help
    4
    6
    290
    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.
    • poof92
      poof92 last edited by

      Variables in my project are being told that they dont exist I need help.

      1 Reply Last reply Reply Quote 0
      • Jongjungbu
        Jongjungbu F last edited by Jongjungbu

        Are your variables only inside functions, conditionals, or loops?
        If so they only exist inside those functions, conditionals and loops and nowhere else.

        Are you attempting to access a global variable from inside a conditional or loop that's nested under several other conditionals or loops?
        I've found you can only go about 4 deep and then it can no longer see the global variable from inside the nested conditional or loop.

        N mixaal 2 Replies Last reply Reply Quote 1
        • N
          Nisse5 F @Jongjungbu last edited by

          @Jongjungbu said in Variable doesn't exist even though it does:

          I've found you can only go about 4 deep and then it can no longer see the global variable from inside the nested conditional or loop.

          Wow, really? Good info! Do you know it this include multiple levels of nested function calls as well?

          Jongjungbu 1 Reply Last reply Reply Quote 1
          • Jongjungbu
            Jongjungbu F @Nisse5 last edited by

            @Nisse5 Oh haven't tried nested function calls beyond 2, so I don't know. Worth investigating!

            1 Reply Last reply Reply Quote 0
            • mixaal
              mixaal F @Jongjungbu last edited by

              @Jongjungbu It might be interesting to try out with recursion.

              1 Reply Last reply Reply Quote 1
              • N
                Nisse5 F last edited by

                I encountered a similar issue just now, where some (2 out of 4) of the member names in a struct was lost when the structure was passed to a function (I printed the content of the struct to verify, and 2 of the members had become something like ". = 43"). I was able to work around it by not calling the function and handle it in the caller instead.

                Will try to create some reproducible code later...

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