Edit Script Window

Home Development System Windows Edit Script Window

With the Edit Script window you can create and modify scripts. There are basically 4 kinds of scripts for the 4 levels of hierarchy, and 4 windows offer Script... buttons to open the script editor: Edit Stack, Edit Backgrounds, Edit Cards, Edit Fields and Controls. Which button on which window you use determines the object whose script you edit.

Note that scripts are saved independently from the other information about an object; if you save a script here, it is changed - you don't need to use the Modify button on the window where you came from as well. This is also the reason why the Script... buttons in those windows stay grey when you are creating an object: You can't save a script for an object that does not yet exist.

How to write scripts is described in chapter Scripting. For examples of simple scripts, have a look at the Shopping demo stack, for more sophisticated scripts check the NameQuiz scripting example.

You write and modify scripts in the large text field of the window. The editor is very basic and offers no high-level support like e.g. syntax coloring or even "Intellisense"-like help for finding names of objects like fields. You are more or less on your own and have to know what to write.

Of course you are free to move text in and out of the editor with Copy (Ctrl-C) and Paste (Ctrl-V) and e.g. use some other tool to edit scripts, but there is no direct support for an "external editor" to make it easy.

If you click the Save button, MoStacks' built-in script compiler checks the script. If there is no error, the script is saved. If there is an error, it is displayed in the fields below the button. Unfortunately, and this is in need of improvement, you are not able to save as long as there is an error; if you don't know how to correct it, your only option is to use the Cancel button and loose all changes to the script since you started to edit.

The compiler always stops at the first error that it detects; it may be that you need several attempts of saving, correcting and trying to save again because of this.