Webseiten Navigation: Airbit | Shop | m-shell.net
Sprachen: EN | DE

The Editor

To write or edit an m script or module, you can use the editor:
To edit an existing script, open it from the script list, then

Series 60:Choose Process→Edit Source.
UIQ:Press the button.

To edit an existing module, simply open it from the script list.

Only one file can be edited at a time: when loading a file, a previously edited file will be saved.

As an example, open the Partytime script and load it into the editor, as explained above.

Series 60 sample screen
UIQ sample screen

Now replace the text "The party starts at 8pm!" by "Sorry, no party tonight!".

You can start the modified script directly from the editor by

Series 60:choosing File→Save & Go
UIQ:pressing the button.

Note that on S60, the confirm button inserts a new line when in the editor.

The editor offers the following menu options:

File→Save & GoSave the file and run the script.
File→Save & CompileSave the file and compile the script.
File→Save AsSave the file (optionally changing the name), but stay in the editor.
File→Save & CloseSave the file, and return to the script list.
File→Save & Send AsSave the file, then send it (e.g. via Bluetooth or as an e-mail attachment).
File→Discard & CloseDiscard any changes, and return to the script list.
File→DeleteDiscard any changes, and delete the file.
File→RenameRename the file.
File→View Size(S60 only): toggle the view size, showing or hiding the title pane.

The →Edit menu is the same as in the console.


On S60, clicking the the shift (select) button once enters pagewise mode: the up and down keys scroll backwards and forward one page at a time. Pressing any other key or clicking the shift button again returns to linewise mode.

On UIQ, the editor offers a vertical scroll bar to quickly move to another part of the source text.

Find and Replace

The editor has a simple find/replace mechanism: Edit→Find opens a dialog where find/replace arguments can be entered. The arguments are:

FindThe text to search for.
ReplaceThe text to replace the search text with.
Find UpSelect whether the initial search direction is up (backwards) or down (forward).
Case s.Select whether the search is case sensitive.
Whole w.Select whether the search only considers whole word matches, ignoring substrings.

To replace all occurences of variable n by variable id in the Partytime script, choose Edit→Find in the editor, then enter the search arguments. Select Whole w., as we only want to find isolated instances of the letter n, not n as part of another word.

Series 60 sample screen
UIQ sample screen

Press →Ok to find the first occurence of n. After starting the search, finding the first occurence and selecting it, the editor enters find mode, indicated by the icon. In find mode, three keys have a special meaning:

S60 KeyUIQ KeyMeaning
Arrow UpJog Dial UpSearch backwards for the next occurrence of the find string.
Arrow DownJog Dial DownSearch forward for the next occurrence of the find string.
ConfirmJog Dial PressReplace this occurrence, then search for the next occurrence of the find string in the same direction as before.

All other keys leave find mode. Find mode is also left if the find string does not occur in the given direction.

Hence, to replace the next occurence of n by id and search the next occurence,

Series 60:press the confirm button.
UIQ:press the Jog Dial.

Series 60 sample screen
UIQ sample screen

© 2004-2011 airbit AG, CH-8008 Zürich
Document AB-M-TUT-887
mShell Home  > Dokumentation  > Manuals