Just to be complete, in a similar way, UDF_Design() (and I suspect Script_Design() as well) does exactly the same thing. Here is it's test code:
Code:
FUNCTION test_code_ed AS C (funcname1 AS C, funcname2 AS C, funcname3 AS C )
'DESCRIPTION: Test code Editor scripteditor_open()/UDF_Design() 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() or UDF_Design 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")
udf_design(funcname1,"")
Statusbar.Set_Text("Opening Function: "+funcname2)
'scripteditor_open(funcname2,"function")
udf_design(funcname2,"")
Statusbar.Set_Text("Opening Function: "+funcname3)
'scripteditor_open(funcname3,"function")
udf_design(funcname3,"")
END FUNCTION
Addendum: The test_code_ed("functionname1", "functionname2", "functionname3") line fails if you press enter at the end of the line in the Interactive editor, but not if you select the code, then press the lightning bolt.
Bookmarks