This is an odd bug of the script editor (fails in A5v8 through A5v11, probably earlier versions too) that is illustrated with a simple example. This is a case where code<>code.
I believe it has something to do with the environment of the interactive window (WITH-END WITH) but can't get the test function to ever work when run from the interactive window. The only real difference is executing Scripteditor_Open()
function individually vs running the same code in a function from the Interactive Window. When run from other Alpha locations, it seems to work.
The 1st Scripteditor_Open() always works in the function, but subsequent ones fails.
Here is a test function with notes in it:
I believe it has something to do with the environment of the interactive window (WITH-END WITH) but can't get the test function to ever work when run from the interactive window. The only real difference is executing Scripteditor_Open()
function individually vs running the same code in a function from the Interactive Window. When run from other Alpha locations, it seems to work.
The 1st Scripteditor_Open() always works in the function, but subsequent ones fails.
Here is a test function with notes in it:
Code:
FUNCTION test_code_ed AS C (funcname1 AS C, funcname2 AS C, funcname3 AS C ) 'DESCRIPTION: Test code Editor scripteditor_open() function ' Illustrates unexplained error. Fails in A5v8 through A5v11, perhaps earlier as well. ' function names can be either "functionname1" or "functionname1()", use names of your own functions ' Running 3 scripteditor_open() lines from the interactive editor (select all text, use lightning bolt) ' or run each individually produces no error, as in ' scripteditor_open("functionname1","function") ' scripteditor_open("functionname2","function") ' scripteditor_open("functionname3","function") ' However, when this function is run from the Interactive Window, as in ' test_code_ed("functionname1", "functionname2", "functionname3") ' it will fail at the opening of the 2nd and 3rd scripts ' Statusbar.Set_Text("Opening Function: "+funcname1) scripteditor_open(funcname1,"function") Statusbar.Set_Text("Opening Function: "+funcname2) scripteditor_open(funcname2,"function") Statusbar.Set_Text("Opening Function: "+funcname3) scripteditor_open(funcname3,"function") END FUNCTION
Comment