Lotus Script Error Message: Subscript out of range.

Lotus Domino
Microsoft Exchange
I've recently taken over support of a homegrown Notes database. An agent runs daily in this database on all documents and pulls data from a flat file (which lives on the same server as database) and uses subroutines to process adds, deletes and changes to person docs in a Name and Address Book. Recently it's stopped working. I get error messages in the log such as error: "Subscript out of range" or "Out of memory not enough system memory". When I run the agent through debug I get an error message "Can't open file". My ID has full Admin rights to the server. Any suggestions would be greatly appreciated.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Without seeing the code, my guess is that your “Subscript out of range” issue is due to the array(s) in the program not being DIMensioned with enough elements. Check the loop that is used to update the array(s) and see if the original programmer has included code to count the number of items being processed and has a provision to REDIMension the array(s). (Check the Lotus Script documentation for more information about DIM and REDIM.)

As to not being able to open the file while in debug mode, check the file permissions on the flat file. You may have full admin rights in Notes, but not have access to the flat file. Even though the flat file may be on the Domino server, your network permissions to that file and / or folder may be limited.

Discuss This Question: 2  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Sirhoser
    Subscript out of range is almost always related to an array index. You're going to have to debug this agent. Do you have an array on integers that get used as filehandles? Something like this? dim aFileNumber() as integer ' filehandle dim Path as String 'file location ...Other code fileNum(i) = Freefile() ...Other code For i = 1 To UBound(fileNum) Open Path For Output As fileNum(i) ...Some Processing... close fileNum(i) next i If you have something like this, you might want to look a this array. Also, look at the Path variable. It could be wrong.
    0 pointsBadges:
  • Maggs
    Three different error messages, interesting. It looks like the originating culprite is the "Can't open file" error message. Locate teh file it is trying to open and determine from the Operating System level that the file exits and then check the file permissions to ensure they haven't been restricted recently. Next, I'd look at the Subscript out of range error. This occurs when teh code is using an array and doesn't resize itself correctly. This couild occur if the agent can't access the info in the file, even if it can open the file. To look at he out of memory issue, which version of Domino are you running, and what Lotus products are on the server? Is it an applicaiton only server, does it run mail also, does it run Domino.Doc or any other product?
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: