Lotus Script: Notes reports error on "phantom" code!

Hi all,

I always get the error message :

“Not a sub or function name : SET_BOUND”

in one of my forms. But I don’t use any script routine with this name and(!) it appears between (!?!?) the events Queryopen and Postopen and the code is not shown in the debugger and obviously does not belong to these two events !!! Have already treid to recompile the entire DB. Didn’t help !

Any ideas ? Will now try to recreate this form in a new form :frowning: But will keep this strange design object.

Subject: Lotus Script: Notes reports error on “phantom” code !

have you tried to use notespeek to locate this function? or using design synopsis of this form.

maybe there’s something wrong with the automatically created parts of lscript you can’t see - they look like this:

'++LotusScript Development Environment:2:5:(Declarations):0:2

(you can view them in notes-peek)

Markus Seitz

markus.seitz@icodex.com

Subject: RE: Lotus Script: Notes reports error on “phantom” code !

Thanks for the info ! Have meanwhile solved the problem by myself, but the hint with the synopsis would for sure have helped me to solve the problem.

I had used an existing little form, had removed all code (now I know better!) added my new fields and could save the form. But two fields contained calls to subs in their exiting event. Theses subs were obviously not longer available , cause I had deleted any other ancient cript code.

The very strange thing is that I was able to safe the form without getting an error and(!) that I got the error message during the opening process of a document between the queryopen and postopen events …

The current version of the script compiler/editor environment needs some improvments. The Notes 5 compiler/editor was better.

Cheers, Joe

Subject: RE: Lotus Script: Notes reports error on “phantom” code !

Right – the source code & compiled code for the field events wasn’t deleted when the underlying field(s) was deleted.

When you add LotusScript to the field events, there are two additional fields added to the note; one for the uncompiled code, and one for the compiled code. So, for example, if you have a field called “Foo” on your form and you add any LotusScript to any of its events, a $$Foo item is added to the note for the the uncompiled source code and a second item, $Foo_O (that’s a capital letter “o” as in oscar), is added for the compiled code. When the “Foo” field is deleted, the other two “internal” fields often remain on the note. Consquently, the code attempts to execute in the client. I don’t know why the client triggers these events since you are obviously not “exiting” (or entering, etc) the field in the client. Maybe the field bindings get screwed up somehow when the field is deleted. When this happens, you can add the “base” field back to the form with no code in any events, save the form, then delete the field again as follows:

place your cursor to the immediate right of the field,

press the key, and

confirm your intentions when prompted to do so.

You can do the same thing with the key on the left side of the field. After deleting the field(s), you should confirm that all items, including the “internal” items, have been removed from the note by looking at the note’s properties in Designer or NotesPeek. Deleting fields in this manner can (sometimes) avoid the problem altogether.

Incidentally, this is also often the reason that field names still appear in view column choices, etc, after they’ve been deleted from all forms & views. The “active” field names should be those in the $Fields item of the form note. If the deleted field names appear on the note, they remain in the UNK table and will still show up in view column choices.

I’ve posted a little utility script to OpenNTF’s Code Bin to clean up these fields by way of the NotesNoteCollection class.

hth,

dgg