Welcome to KORG! Sometimes all it takes is explaining the problem to see it yourself! (glad we all could help! \:D )

Couple of suggestions - you might want to implement better error control/traps.. consider
 Code:
$OK = 1		; assume success
If Open(1, "L:\Sigrity_UPD\master_strips\Unit_Array\unit_array_info.txt", 0) = 0
 $DWG_NUMBER = ReadLine(1)
 $DWG_REVISION = ReadLine(1)
 $SOURCE_FOLDER = ReadLine(1)
Else
  ('Cannot find the file') ?
  $OK = 0	; no file, no success!
EndIf

Close (1)
; gerber name = 123456GBL010A.GBR

If $OK		; process only if file was found

  $CheckFile = $SOURCE_FOLDER + 'unit.dxf'

  ;Rename the gerber files
  $TIME_OUT = 0
  WHILE $TIME_OUT < 300
    If Exist($CheckFile ) ;Check for unit.dxf
      If Exist($SOURCE_FOLDER + 'EB01.gbr' ) MOVE $SOURCE_FOLDER + 'EB01.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBEB01' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'EB04.gbr' ) MOVE $SOURCE_FOLDER + 'EB04.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBEB04' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'INNER.gbr' ) MOVE $SOURCE_FOLDER + 'INNER.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBINNER' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'L01.gbr' ) MOVE $SOURCE_FOLDER + 'L01.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBL01' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'L04.gbr' ) MOVE $SOURCE_FOLDER + 'L04.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBL04' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'S01.gbr' ) MOVE $SOURCE_FOLDER + 'S01.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBS01' + $DWG_REVISION + '.gbr' EndIf
      If Exist($SOURCE_FOLDER + 'S04.gbr' ) MOVE $SOURCE_FOLDER + 'S04.gbr' $SOURCE_FOLDER + $DWG_NUMBER + 'GBS04' + $DWG_REVISION + '.gbr' EndIf
      $TIME_OUT = 300
    Else
      sleep 20
      $TIME_OUT = $TIME_OUT + 20
    EndIf
  Loop
EndIf
You could also simply replace the $OK=0 with a Close(1) and an Exit 2, eliminating the If $OK block. Either way, you would not process the main code if the first file wasn't able to be opened.

Look at the Sanity() UDF or grab the Kix Development Kit from my web site and use KGen to scan your script for common errors like this.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D