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.
![]() | ![]() | |
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 & Go | Save the file and run the script. |
| File→Save & Compile | Save the file and compile the script. |
| File→Save As | Save the file (optionally changing the name), but stay in the editor. |
| File→Save & Close | Save the file, and return to the script list. |
| File→Save & Send As | Save the file, then send it (e.g. via Bluetooth or as an e-mail attachment). |
| File→Discard & Close | Discard any changes, and return to the script list. |
| File→Delete | Discard any changes, and delete the file. |
| File→Rename | Rename 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 UIQ, the editor offers a vertical scroll bar to quickly move to another part of the source text.
The editor has a simple find/replace mechanism: Edit→Find opens a dialog where find/replace arguments can be entered. The arguments are:
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.
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 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,
Find and Replace
Find The text to search for. Replace The text to replace the search text with. Find Up Select 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. 

icon. In find mode, three keys have a special meaning:
S60 Key UIQ Key Meaning Arrow Up Jog Dial Up Search backwards for the next occurrence of the find string. Arrow Down Jog Dial Down Search forward for the next occurrence of the find string. Confirm Jog Dial Press Replace this occurrence, then search for the next occurrence of the find string in the same direction as before. Series 60: press the confirm button. UIQ: press the Jog Dial. 

Next: The Properties Dialog
Document AB-M-TUT-869