Hiding and showing form repeatedly causes 'Out of Range'

Hello,
I have a button on my main form that hides the main form. After creating a form from within the script, on a dblclick of the listbox also created from the script, I have a button that shows the main form. After hiding,showing,hiding,showing,etc. about 30 times, I get an ‘Out of Range’ Error ? Any Ideas? There should be nothing happening except Form.show and form.hide. It gets the error from the following line:
Decl := TPSInternalProcRec(Self^.Se.FProcs[Self^.ProcNo]).ExportDecl;
in upsRuntime.pas
Do you have any ideas?

Thanks,
Ken

That sounds like somehow the script gets cleared or corrupted than a bug in the script engine.

Is there anything I can do to help find why the script may be corrupted?
MadExcept shows that there are no memory leaks.
I have gone over and over and can’t find a smoking gun.

Thanks,
Ken