3 Replies Latest reply on Feb 7, 2008 8:27 AM by UdoGre

    problem with repeat with

    sensiblemind
      hi all
      am trying to make photo gallery, and its all great till now , BUT when i mark image as favorites i import the same images into anther cast and i check here if the same image is already existed or not and i found the problem
      the code is

      repeat with xx=1 to the number of members of castLib 3

      if member(xx,3).name = idpic then

      alert(member(xx,3).name)
      alert ("this item found before")
      nothing
      else
      importfileinto member(nextaddimg,3), getthepic
      end if
      end repeat

      the alert statment is runnin well but :S
      don't know
      can u help plz ?
        • 1. problem with repeat with
          UdoGre Level 1
          Hi Sensible mind,

          What happens if the first member of cast 3 is not the one you want to add? The else-path will be used, and the image added.
          What happens then when the second picture also is not the one you want to add? The else-path will be used, and the image added. Again.
          This will continue until you reach the first image created in the first step here. After that, the loop will run through the other members and exit finally.

          Allow me to change your code a little bit:
          edit: changed html quote entities back

          • 2. Re: problem with repeat with
            sensiblemind Level 1
            thnx UdoGre but the answer of ur Q is in anther part of my code
            anyway real thnx BUT did u try ur code ??
            it do the same here
            and doesn't work well
            • 3. Re: problem with repeat with
              UdoGre Level 1
              Hi Sensible Mind,

              No, I did not try the code, the only part that will not work is within the alert command, where the quote signs are replaced by html entities. You have to correct that part yourself. Other than that, there might be the odd typing error.
              The rest of the code is copied from your code.

              The questions I asked were rhetorical, sorry I didn't indicate that.

              HTH,

              Udo

              P.S. Since english is not my native language, I'd appreciate you to use a language not so much truncated. I have to read it several times to follow you there.