Specifying a procedure in Database options = internal error

What am I misunderstanding about this statement from the Help:

“The list of initial windows can also include one or more procedures, type PROCEDURE: followed by the name of the procedure (again, the name must be exact, including the exact capitalization)”

Is this the place I’d put code that was fashionable in the old “.Initialize” procedure? The procedure specified would define my variables and put the database in a “known” order, sorting, cleaning out summaries, filling my form text display objects, moving to an expected field, etc.

I have tried this several ways - PROCEDURE: a space after the colon or not, the procedure name in quotes (name. has no spaces) or not. My procedure just runs a simple message “hello” to see if it’s firing.

The error message is consistent
Internal Error in dialog logic
arraysearch( function: ARRAY parameter must be text or binary.

No. There’s nothing old-fashioned about .Initialize, it works the same as it always has.

This isn’t going to run the code in this procedure, it’s going to open the window of the procedure. It’s pretty unusual to want a procedure window to open when the database opens, but if that’s what you want, you can do it. Just do what it says, put in the name of the procedure – no quotes, no spaces, etc.

NEWS FLASH! This feature doesn’t currently work - just as you say, trying to add a procedure window causes an error in the dialog. I have fixed this so it will work in the next release. But this won’t slow you down, because you don’t want to use this feature anyway. :point_down:

That sure sounds like code that you want to put in the .Initialize procedure. Just put the code there, and forget about the initial windows feature – that isn’t what you want for this task.

I would strongly discourage you from putting a modal alert in automatic code like the .Initialize procedure, or any code that runs automatically. In previous versions of Panorama X this wouldn’t even work at all – I think it does work now but you should still avoid it. Instead use nsnotify, or use zlog with the debug instrumentation feature.

Thank you Jim, I wouldn’t normally put a model alert in automatic code like .initialize but I was trying the simplest procedure as test.

You are correct sir, I would more likely have a use for FlashAudio than I would open a procedure window at the launching of a database file.

nsnotify - a new toy to chew on. :slightly_smiling_face: