WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileClose Greater than 5 Files Error

Keywords:     fileclose

Question:

When a certain file is run it gets the date and time then writes it to a log file. After it writes 5 times I get the Error >5 files open. I can step through with debug and it looks like everything is being processed properly, but after 5 writes it goes Kaput. The code is straight from the book. Any Ideas?

This is the code:

:LOG
  IF FILEEXIST(LOGFILE) THEN
      FMODE = "APPEND"
  ELSE
      FMODE = "WRITE"	
  END IF

 HOLD=FILEOPEN(LOGFILE,"%FMODE%")

  FILEWRITE(HOLD, "%LOGLINE%")
  FILECLOSE(HOLD)

  RETURN

Answer:

This particular code sample looks good. I suspect you are doing a FileOpen elsewhere without a FileClose, and it just catches up with you here.

If you are running your WBT script, by first launching WINBATCH.EXE (or WBAT16I.EXE), then you will run into this 5 file limitation. The solution is to launch your script from File Manager or Explorer, by double clicking on your WBT file.


Article ID:   W13059
Filename:   FileClose Greater than 5 Files Error.txt
File Created: 1999:04:15:16:51:28
Last Updated: 1999:04:15:16:51:28