Basics

Home Scripting Basics

Scripts are small programs written in a language inspired by HyperTalk, the script language of Apple's HyperTalk. MoStacks has a component called an interpreter to run the programs on both platforms, on Windows and on Symbian/UIQ3.

MoStacks scripting primarely targets smartphone "power" users with a basic unterstanding of logic and programming, not the professional programmer. It has no ambition whatsoever to replace full stand-alone scripting languages like Python, much less C++. The language is quite simple and should be easy to understand and learn - Apple designed it with that goal in mind.

There is a component called a compiler which checks scripts and translates them into byte code that allows much faster execution than directly "running" them from their original text. The compiler is only implemented for Windows. This means that you can execute scripts on your phone, but you cannot change them, and you cannot write new scripts on the phone.

With the exception of the Answer statement scripts have no way to interact directly with the user. The philosophy here is that scripts tightly interact with the stack that contains them: Values in certain fields serve as input, and output will "appear" again as values in certain fields.

Scripts always stored together with some object: the stack itself, a background, a card or a field/control. All the 4 windows that allow you to configure those objects have a Script... button that opens the Edit Script window where you can write scripts.

You don't start scripts per se; there is no Run Script command. Scripts are executed as reaction to so-called messages, as explained in chapter Messages. The most common scenario here: For a certain background, you create a Command control that is displayed as a button, and if you tap on this button your script for that control that listens to the Select message is executed.