Yes, it was assuming that there was a database named currentDBname. That way, you don’t have to quote the database name in the normal case of a fixed database.
Your procedure has some other potential problems. The two lines of code after the newdatabase statement
newWindow = info("windoname")
don’t do anything. The active database is already the new database, so you don’t need these two lines.
The final line of code,
also doesn’t do anything. The active database is already associated with the current window. (Note: I’m assuming that
.myRoutines doesn’t use a secret window, in that case
setactivedatabase "" would do something, but it would be much cleaner to put it in the
.myRoutines code if so.)
.myRoutines doesn’t use secret windows, your code could be reduced to:
let originalDatabaseName = info("databasename")
(I changed the name of the variable because I think calling it “current” is confusing, since it isn’t current. But of course it’s your code, so use any name you like.)
P.S. It warms my heart to see someone using callwithin. I don’t know how many of you use it, but I love it and use it frequently. Really helps to cut down the number of items in the View menu and help keep code organized.