Honestly I don't know if this belongs in HTML, or VBScript... I am trying to update a graphic editing HTML based tool. Here's how its set up:
====================================================================================================
1. QA.htm contains procedure Sub LoadFile() written in vbscript. The file defines 2 frames: "header" and "mainFrm"
</HEAD>
<frameset rows="64,*">
<frame name="header" src="header.htm" scrolling="no">
<frame name="mainFrm" src="Toc.htm" scrolling="auto">
</frameset>
</HTML>
2. header.htm contains a form (<form name="myform" action="checkboxes.asp" method="post">) that holds a table of controls that the user uses to set up display options
3. Toc.htm is a list of graphic filenames that the user can click to load the graphic to view. Code example:
<BR><a href="JavaScript:top.LoadFile('abc123-001')">abc123-001</a>
4. ig.htm sets up the "view graphic" object with a few viewing tools (zoom in/out, highlight line, etc)
5. IG_Vert.htm is a "shell" that sets up two instances of ig.htm in vertical side-by-side frames
<HTML><HEAD></HEAD>
<frameset cols="50%,*">
<frame name="IG1" src="IG.htm" scrolling="no" maginwidth="0" marginheight="0">
<frame name="IG2" src="IG.htm" scrolling="no" maginwidth="0" marginheight="0">
</frameset>
</HTML>
6. IG_Horz.htm is a "shell" that sets up two instances of ig.htm in horizontal stacked frames
<HTML><HEAD></HEAD>
<frameset rows="50%,*">
<frame name="IG1" src="IG.htm" scrolling="no">
<frame name="IG2" src="IG.htm" scrolling="no">
</frameset>
</HTML>
====================================================================================================
HOW IT WORKS:
When the user opens QA.htm they see the header frame at the top and the mainFrm on the bottom. Initially mainFrm contains a list of filenames from Toc.htm. When they click on a filename, the Toc.htm link calls the procedure LoadFile() using: <BR><a href="JavaScript:top.LoadFile('abc123-001')">abc123-001</a>
Inside LoadFile() the graphic variable are set up, then the frame mainFrm changes to show IG_Horz.htm (This is accomplished with the statement: top.mainFrm.location="IG_Horz.htm"), and finally the graphics are loaded.
Here's an excerpt from LoadFile()
sub LoadFile (filename)
.
.
.
[LINE 47] top.mainFrm.location="IG_Horz.htm"
[LINE 48] top.header.myform.Diagram.value = currentFile
[LINE 49] top.mainFrm.IG1.file_name.value = CStr(currentFile & "." & currentExtension)
[LINE 50] top.mainFrm.IG1.IGView1.LoadFileVP CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
[LINE 51] top.mainFrm.IG1.IGView1.SetHome CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
end sub
====================================================================================================
HERES THE PROBLEM:
When I run the code as displayed, I get the following error when I hit LINE 49:
An error has occured in this dialog
Error: 84
Unspecified error.
No other information is given, no line number or character, etc.
Now, before you ask to see all the code, please read this... I know what line number causes the error because I went back and inserted "Msgbox" all over until I found the problem. Funny thing about it tho, is that if the function message box is inserted into the code after [LINE 47], but before [LINE 49], everything works just fine (see below).
This is the reason I didn't just to a code dump. I know everything works (when Msgbox is used). I seems like its a "focus" issue almost like the program gets lost after mainFrm source file is changed to IG_Horz.htm.
[LINE 47] top.mainFrm.location="IG_Horz.htm"
Msgbox "1"
[LINE 48] top.header.myform.Diagram.value = currentFile
[LINE 49] top.mainFrm.IG1.file_name.value = CStr(currentFile & "." & currentExtension)
[LINE 50] top.mainFrm.IG1.IGView1.LoadFileVP CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
[LINE 51] top.mainFrm.IG1.IGView1.SetHome CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
Here's what I've tried to do. I have tried to set the focus to one of the other frames with top.header.myform.Diagrm.focus() (also tried parent. window. window.parent .frames(1) .frames("header") etc) I tried taking [LINE 47] out of LoadFile() and put it in its own function (still works identically the same as long as Msgbox is put between it and [LINE 49], tried swapping [LINE 49] and [LINE 50] around, and probably a couple of other things I can't remember.
So if you've run across this before, I would appreciate any help.
Let me know if you need more information, but keep in mind that everything works just great as long as Msgbox is in there. And for those of you who are thinking it, NO, I dont want to leave Msgbox in there! I dont want the user to have to click on an extra button for no reason.
====================================================================================================
1. QA.htm contains procedure Sub LoadFile() written in vbscript. The file defines 2 frames: "header" and "mainFrm"
</HEAD>
<frameset rows="64,*">
<frame name="header" src="header.htm" scrolling="no">
<frame name="mainFrm" src="Toc.htm" scrolling="auto">
</frameset>
</HTML>
2. header.htm contains a form (<form name="myform" action="checkboxes.asp" method="post">) that holds a table of controls that the user uses to set up display options
3. Toc.htm is a list of graphic filenames that the user can click to load the graphic to view. Code example:
<BR><a href="JavaScript:top.LoadFile('abc123-001')">abc123-001</a>
4. ig.htm sets up the "view graphic" object with a few viewing tools (zoom in/out, highlight line, etc)
5. IG_Vert.htm is a "shell" that sets up two instances of ig.htm in vertical side-by-side frames
<HTML><HEAD></HEAD>
<frameset cols="50%,*">
<frame name="IG1" src="IG.htm" scrolling="no" maginwidth="0" marginheight="0">
<frame name="IG2" src="IG.htm" scrolling="no" maginwidth="0" marginheight="0">
</frameset>
</HTML>
6. IG_Horz.htm is a "shell" that sets up two instances of ig.htm in horizontal stacked frames
<HTML><HEAD></HEAD>
<frameset rows="50%,*">
<frame name="IG1" src="IG.htm" scrolling="no">
<frame name="IG2" src="IG.htm" scrolling="no">
</frameset>
</HTML>
====================================================================================================
HOW IT WORKS:
When the user opens QA.htm they see the header frame at the top and the mainFrm on the bottom. Initially mainFrm contains a list of filenames from Toc.htm. When they click on a filename, the Toc.htm link calls the procedure LoadFile() using: <BR><a href="JavaScript:top.LoadFile('abc123-001')">abc123-001</a>
Inside LoadFile() the graphic variable are set up, then the frame mainFrm changes to show IG_Horz.htm (This is accomplished with the statement: top.mainFrm.location="IG_Horz.htm"), and finally the graphics are loaded.
Here's an excerpt from LoadFile()
sub LoadFile (filename)
.
.
.
[LINE 47] top.mainFrm.location="IG_Horz.htm"
[LINE 48] top.header.myform.Diagram.value = currentFile
[LINE 49] top.mainFrm.IG1.file_name.value = CStr(currentFile & "." & currentExtension)
[LINE 50] top.mainFrm.IG1.IGView1.LoadFileVP CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
[LINE 51] top.mainFrm.IG1.IGView1.SetHome CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
end sub
====================================================================================================
HERES THE PROBLEM:
When I run the code as displayed, I get the following error when I hit LINE 49:
An error has occured in this dialog
Error: 84
Unspecified error.
No other information is given, no line number or character, etc.
Now, before you ask to see all the code, please read this... I know what line number causes the error because I went back and inserted "Msgbox" all over until I found the problem. Funny thing about it tho, is that if the function message box is inserted into the code after [LINE 47], but before [LINE 49], everything works just fine (see below).
This is the reason I didn't just to a code dump. I know everything works (when Msgbox is used). I seems like its a "focus" issue almost like the program gets lost after mainFrm source file is changed to IG_Horz.htm.
[LINE 47] top.mainFrm.location="IG_Horz.htm"
Msgbox "1"
[LINE 48] top.header.myform.Diagram.value = currentFile
[LINE 49] top.mainFrm.IG1.file_name.value = CStr(currentFile & "." & currentExtension)
[LINE 50] top.mainFrm.IG1.IGView1.LoadFileVP CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
[LINE 51] top.mainFrm.IG1.IGView1.SetHome CStr(subdir1 & currentFile & "." & currentExtension), "allnocolors"
Here's what I've tried to do. I have tried to set the focus to one of the other frames with top.header.myform.Diagrm.focus() (also tried parent. window. window.parent .frames(1) .frames("header") etc) I tried taking [LINE 47] out of LoadFile() and put it in its own function (still works identically the same as long as Msgbox is put between it and [LINE 49], tried swapping [LINE 49] and [LINE 50] around, and probably a couple of other things I can't remember.
So if you've run across this before, I would appreciate any help.
Let me know if you need more information, but keep in mind that everything works just great as long as Msgbox is in there. And for those of you who are thinking it, NO, I dont want to leave Msgbox in there! I dont want the user to have to click on an extra button for no reason.