0 Replies Latest reply on Feb 17, 2009 2:28 AM by Almudever

    Too many repetition

    Almudever
      My problem is the next:
      I have to repeat many times the same code for open different txt with fileIO and a chunck of code is the next. How I can reduce the repetitions? I tried with repeat loop but it doesn't work. Can you help me?
      The pattern whic is repeated is:

      myFile01 = xtra ("fileio").new()
      openFile(myFile01,the moviePath&"Test"&fileSep&"Tema_1"&fileSep&"t01.txt",1)
      nada = readWord(myFile01)
      titulo_01 = readLine(myFile01)

      if titulo_01 = VOID then

      continue
      else
      Q=1
      testList.add("myFile01")

      ---------------------------------------------------------------------------
      myFile02 = xtra ("fileio").new()
      openFile(myFile02,the moviePath&"Test"&fileSep&"Tema_1"&fileSep&"t02.txt",1)
      nada = readWord(myFile02)
      titulo_02 = readLine(myFile02)

      if titulo_02=VOID then

      continue
      else
      Q=2
      testList.add("myFile02")

      ---------------------------------------------------------------------------
      myFile03 = xtra ("fileio").new()
      openFile(myFile03,the moviePath&"Test"&fileSep&"Tema_1"&fileSep&"t03.txt",1)




      And so, and so until 50 times