3 Replies Latest reply on Sep 11, 2006 12:06 AM by Newsgroup_User

    Help me to forget my MIAWs

    Opera Rat Level 1
      I have hyperlinks which open a glossary window (MIAW) and then hyperlinks within the glossary window that open more MIAWs. I can close them alright, but I can't forget them. I know that forgetting them from within them can cause problems. So I have the script below trying to forget them that gets run at certain points in the score. It only closes window 3. I tried it with forget window(i) and it didn't like that. Does anyone see what is wrong with my script.

      Here is my window list. I need to keep stage and fugue01 open.
      -- [(window "stage"), (window "fugue01"), (window "glossary2 4"), (window "glossary2 6"), (window "glossary2 8"), (window "glossary2 10"), (window "glossary2 12"), (window "glossary"), (window "glossary2 9")]


      on forgetGlossary
      n = count(the windowList)
      repeat with i = 3 to n
      forget window(1)
      end repeat
      end
        • 1. Re: Help me to forget my MIAWs
          Level 7
          > Here is my window list. I need to keep stage and fugue01 open.
          > -- [(window "stage"), (window "fugue01"), (window "glossary2 4"), (window
          > "glossary2 6"), (window "glossary2 8"), (window "glossary2 10"), (window
          > "glossary2 12"), (window "glossary"), (window "glossary2 9")]
          >
          >
          > on forgetGlossary
          > n = count(the windowList)
          > repeat with i = 3 to n
          > forget window(1)
          > end repeat
          > end

          As soon as you forget the window at index 3, it is removed from the
          windowList and the remaining windows have their index shifted down 1.
          Try instead:
          on forgetGlossary
          n = count(the windowList)
          if n > 3 then
          repeat with i = n down to 4
          forget window(1)
          end repeat
          end if
          end
          • 2. Re: Help me to forget my MIAWs
            Opera Rat Level 1
            Thank you Sean. Your script worked once I changed the forget window(1) to forget window(i). Now I think I have just one more issue with my entire program and then it's just more of the same (that is until I discover some other problem that never crossed my mind).
            • 3. Re: Help me to forget my MIAWs
              Level 7
              > Your script worked once I changed the forget window(1) to
              > forget window(i).

              Whoops - well spotted!