1 Reply Latest reply on Dec 11, 2006 8:18 AM by duckets

    Help with global variables

    N_snyder
      Hey all...
      I'm stumped

      global tSubject,
      on showMessages me, pop

      pd = the last char of the moviepath

      inboxDir = the moviepath & "inbox" & pd
      attachmentDir = the moviepath & "inbox_attachments" & pd

      cnt = count(pop.pMails)
      global tSubject = popObj.getSubject(cnt)

      put global tSubject into member 20

      end


      it was saying "Variable used before variable assigned" before I basically put global in front of everything. Now it's saying comma expected and it's not letting me pull up the debugger at all. You can successfully get all of the handlers by [put script("POP").handlers() ] and getSubject is definately one of them. I basically want to take the result of getSubject and put it into a text field sprite (member 20). Can anyone out there help me?

      Thanks.
        • 1. Re: Help with global variables
          duckets Level 1
          You have a number of errors in your script. The debugger will only work if director encounters an error while running. If your script has basic syntax errors, then it won't run at all, and so you can't use the debugger.

          First, you only need to declare a variable 'global' once, at the top of your script, not each time you use the variable, so delete all occurrences of 'global' except your first.

          Second, You're referring to a variable called 'popObj', which isn't referenced anywhere else. This is probably your "used before assigned" problem. Did you mean to write 'pop' instead of 'popObj' there?

          With those two errors fixed, you can now run your movie and debug any run-time errors which might remain! :-)

          hope this helps,

          - Ben