Prev: The Console
Script Files
m scripts and modules are just files stored on the file system of your phone. Since they are files, you can manipulate them using a file explorer application or using m, and transfer them to other devices.
These files are located in the document directory of the m application. This directory can be changed from within the application by navigating between folders (i.e., subdirectories).
Scripts have the file extension .m, modules the extension .mm, and compiled executables the extension .mex. For instance, the Partytime script might correspond to file c:\documents\mShell\Partytime.m. You can easily verify this from within a shell: open a shell (e.g. with ) and try the following (you don't have to enter the comments starting with //):
// get the document directory from module system
m>use system system.docdir
→ c:\documents\mShell\
// show the file contents
type(system.docdir+"Partytime.m")
→ /*
A very simple m SMS
service: anybody sending
the keyword "party" will
get a standard reply.
*/
use sms
|
Sending and Receiving m Files
Since
m scripts and modules are ordinary files, you can send them to other phones or a PC, and you can also receive them. The easiest way to transfer files is usually via Bluetooth, but other transport media like USB cable, Internet or MMS are also possible.
Next: Compiling m Scripts© 2004-2011 airbit AG, CH-8008 Zürich
Document AB-M-TUT-887