﻿ErrorLevel( "off"|"critical"|"syntax"|"error"|"warn" )
Set( <variable>,<expression> ) #better use <variable> = <expression>
Clear( <variable> )
Local( [ <variable> {, <variable} ] )
Global( <variable> {, <variable} )
string = Part( <string>,<seperator>,<index>[,<trim?>] )
int    = Length( <string> )
string = SubStr( <string>,<start>,<length> )
string = CharAt( <string>,<position> )
int    = Find( <string>,<search string>[,<start>] )
string = Replace( <string>,<search string>,<new string> )
int    = ReverseFind( <string>,<search character> )
string = ToUpper( <string> )
string = ToLower( <string> )
string = RepeatString( <string>, <count> )
string = UCChar( <unicode value> )
string = UCValue( <character> )

string = Format( <number>, <digits after decimal point> [, <min. digits before decimal point> ] )
string = NumberToHex( <number> )
int    = HexToNumber( <string with hex number> )
int    = Ceil( <number> )
int    = Floor( <number> )
int    = Round( <number> ) (<.5 floor, >=.5 ceil)
float  = Sin( <radians> ) # (radians = degree*PI/180)
float  = Cos( <radians> )
float  = Tan( <radians> )
float  = Log( <number> ) # (based to EULERT / "e")
float  = Log10( <number> ) # (based to 10)
float  = Sqrt( <number> ) # (square root)
int    = CompareFloat( <number>, <number>, <precition> )
value  = Min( <value>, <value> {,<value>} )
value  = Max( <value>, <value> {,<value>} )

Split( <string>,<seperator>,<trim?>,<variable>{,<variable>} ) # if only one variable, it's used as array
array = Split( <string>,<seperator> [,<trim?>] )
array = Array( value {, value } )
array = Map( key, value {, key, value} )
int   = MaxIndex( array ) # last defined element with numerical index starting from 1
int   = ElementCount( array ) # complete count of all elements, incl. alphanumerical indexes and cleared entries

value  = Eval( <expression as string> ) # e.g. res = Eval("var" & index & " & ""...""") 

Run( <application> [, <parameter>] )
RunWait( <application> [, <parameter>] )
New( <menu entry> ) # Windows Mobile only

RunAt( <unix timestamp>, <application> [, <parameter>] )
RunAt( <year>, <month>, <day>, <hour>, <minute>, <application> [, <parameter>] )
RunOnPowerOn( <application> [, <parameter>] )
RemoveNotifications( <application> [, <parameter>] )

Show( <window title> )
Minimize( <window title> )
Close( <window title> )
string = ActiveWindow()
bool   = WndActive( <window title> )
bool   = WndExists( <window title> )
WaitFor( <window title>,<seconds> )
WaitForActive( <window title>,<seconds> )
string = WindowText( <x>, <y> )
GetWindowPos( <window title>, <left>, <top>, <right>, <bottom> )
int    = WndLeft( <window title> )
int    = WndRight( <window title> )
int    = WndTop( <window title> )
int    = WndBottom( <window title> )
SendSpecial( <key> [, <state> ]) # Available keys (quoted string): Alt, Ctrl, Shift, CR, Win, Context, Tab, ESC, Space, Up, Down, Left, Right, Home, End, PageUp, PageDown, Delete, Backspace, Insert, Snapshot, F1 - F12, LeftSoft, RightSoft # Availabe states (quoted string): up, down - omit parameter for short press
SendOK [ ( <window title> ) ]
SendCancel [ ( <window title> ) ]
SendYes [ ( <window title> ) ]
SendNo [ ( <window title> ) ]
SendCommand( [<window title>,] <command id> )
SendMessage( [<window title>,] <message id>, <wparam>, <lparam> ) # only numerical parameters supported!
int = SendMessage( [<window title>,] <message id>, <wparam>, <lparam> ) # same as above as function
PostMessage( [<window title>,] <message id>, <wparam>, <lparam> ) # only numerical parameters supported!

SendKeys( [<window title>,]<string> )
Send<special character> [ ( <window title>,<ctrl>,<shift> ) ] # Special charaters: CR, Tab, Esc, Space, Backspace, Delete, Insert, Up, Down, Left, Right, Home, End, PageUp, PageDown, LeftSoft, RightSoft, Win, Context
Snapshot [ ( <window title> ) ]
SendCtrlKey( [<window title>,]<key> )

MouseClick( [<window title>,]<x>,<y> )
MouseDblClick( [<window title>,]<x>,<y> )
MouseDown( [<window title>,]<x>,<y> )
MouseUp( [<window title>,]<x>,<y> )

Sleep( <milliseconds> )
SleepMessage( <seconds>,<message>[,<title>[,<allowOK>[,<condition]]] )
WaitFor( <window title>,<seconds> )
WaitForActive( <window title>,<seconds> )

int    = TimeStamp() # local time as Unix timestamp
int    = TimeStampUTC() # UTC time as Unix timestamp
string = FormatTime( <format> [, <timestamp> ] ) # formatted
string = TimeZoneName() # Name of current timezone
int    = TimeZoneBias() # offset to UTC in minutes
bool   = TimeZoneDST() # Daylight Saving Time active?
GetTime( <hour>,<minute>,<seconds>[,<day>,<month>,<year>] ) # variable references!
SetTime( <hour>,<minute>,<seconds>[,<day>,<month>,<year>] )

Copy( <source file>,<target file>[,<overwrite?>] )
XCopy( <source files>,<target directory>[,<overwrite?>[,<recursive?>]] )
Rename( <source file>,<target file>[,<overwrite?>] )
Move( <source files>,<target directory>[,<overwrite?>[,<recursive?>]] )
Delete( <files> )
DelTree( <files or directory> )
CreateShortcut( <shortcut file>,<target file>[,<overwrite?>] )

string = IniRead( <file/url>,<section>,<key> )
IniWrite( <file>,<section>,<key>,<value> )
string = ReadFile( <file/url> [,<length> [,<codepage>]] )
string = ReadLine( <file/url> [,<codepage>] )
WriteFile( <file>,<contents>[,<append?>[,<codepage]] )

bool   = FileExists( <file> )
bool   = DirExists( <directory> )
int    = FileCreateTime( <file> )
int    = FileModifyTime( <file> )
int    = FileSize( <file> [, BYTES|KB|MB|GB] ) (max. 2147483647)
int    = FreeDiskSpace( <directory> [, BYTES|KB|MB|GB] ) # max. 2147483647
int    = TotalDiskSpace( <directory> [, BYTES|KB|MB|GB] ) # max. 2147483647
bool   = FileAttribute( <file>, <attribute> )
bool   = SetFileAttribute( <file>, <attribute>, <set?> ) # Allowed values for "attribute": hidden, readonly, system, archive (<- changeable), directory, romfile, compressed (<- cannot be set, romfile only for WM)
SetFileAttribs( <file>,<readonly>[,<hidden>[,<archive>]] ) (1=set,0=remove,""/omit=keep)
string = FileVersion( <file> )
GetVersion( <file>,<variable>,<variable>,<variable>,<variable> )
array  = DirContents( <directory>, <type> ) # type = DC_FILES, DC_DIRS, or DC_ALL

ZipFile( <source file>,<zip file>,<filename in archive>[,<rate>] )
ZipFiles( <source files>,<zip file>[,<subdirectories?>[,<path in zip>[,<rate>]]] )
UnzipFile( <zip file>,<filename in archive>,<target file> )
UnzipAll( <zip file>,<target directory> )
UnzipPath( <zip file>,<path in archive>,<target directory> )

Connect( <connection name> )   #for fixed connection name
Connect( <title>, <message> )  #for selection of connections
Connect                        #for default http connection
CloseConnection                #closes only connection established by "Connect"
Disconnect                     # closes all connections (GPRS, ActiveSync, ...)
bool   = Connected()
bool   = InternetConnected( [<url>] )
SetProxy( <proxy> )            #not necessary if Connect was used
Download( <url>,<target file> )

MkDir( <directory> )
RmDir( <directory> )
ChDir( <directory> ) # PC version only!
SystemPath( <path> ) # valid values for path: ProgramsMenu, StartMenu, Startup, Documents, ProgramFiles, ScriptExe, ScriptPath, ScriptName, ScriptExt

RegWriteString( <root>,<path>,<key>,<value> )
RegWriteDWord(  <root>,<path>,<key>,<value> )
RegWriteBinary( <root>,<path>,<key>,<value> )
RegWriteMultiString( <root>,<path>,<key>,<value> ) # value should be an array
value = RegRead( <root>,<path>,<key> )
RegDelete( <root>,<path>,<key> )
RegDeleteKey( <root>,<path>,<values?>,<recursive?> )
bool  = RegKeyExists( <root>,<path> )
bool  = RegValueExists( <root>,<path>,<value> )

string = Input( <message> [,<title> [,<numeric?> [, <multiline?> [, <default> ]]]] )
Message( <text>[,<title>] )
SetMessageFont( <font size>, <font name> )  # for BigMessage, SleepMessage, Input; Message uses a system dialog that doesn't support own fonts!
BigMessage( <text>[,<title>] )
SleepMessage( <seconds>,<message>[,<title>[,<allowOK>[,<condition]]] )
int    = Question( <message> [,<title> [,<type>]] )  # Type=OkCancel,YesNo,YesNoCancel; Yes/OK=1,No=0,Cancel=2
SetChoiceEntryFormat( <item height> [, <font size>, <font name> ] )
int    = Choice( <title>,<message>,<default>,<timeout>,<array> ) # if only one text is given, it's assumed to be a array variable
int    = Choice( <title>,<message>,<default>,<timeout>,<text1>,<text2>{,<text3>} ) # if only one text is given, it's assumed to be a array variable
string = SelectDirectory( <title>, <message> [,<default>] )
string = SelectFile( <title>, <save?> [, <filter> [, <info> [,<default>]]] )

StatusInfo( <title> [, <list info> ] ) # title and list info text
StatusType( ST_HIDDEN|ST_LIST|ST_MESSAGE [, <keepOpen>] [, <allowCancel> ]] )
StatusHistorySize( <count> ) # number of entries in list
StatusMessage( <message> [, <style> [, <keepOpen>] [, <allowCancel>  ]]] )
StatusMessageAppend( <message> )  # appends last message
StatusRemoveLastMessage()
StatusClear() # removes all previous messages
StatusShow() # bring status window to foreground
StatusListEntryFormat( <item height> [, <font size>, <font name> ] )
WriteStatusHistory( <file name> [, <append> [,<encoding>]] )

bool   = SupportsProcHandling()  # For PNAs, check if ProcExists and Kill will work
bool   = ProcExists( <process name> )
bool   = ScriptProcExists( <script name> )
string = ActiveProcess( [ <full path?> ] )
string = WindowProcess( <window title> [, <full path?> ] )
Kill( <process name> )
KillScript( <script name> )

int = GetVolume() # Windows Mobile only
SetVolume( <value> ) # Windows Mobile only
PlaySound( <wav file> )
Vibrate( <milliseconds> )

int    = ColorAt( <x>,<y> )
int    = RGB( <red>,<green>,<blue> )
int    = Red( <color> )
int    = Green( <color> )
int    = Blue( <color> )
array  = ScreenToChars( <x>, <y>, <width>, <height>, <color> [, <background color?> [, <foreg. char> [, <backg. char> ] ] ] )
Rotate( 0|90|180|270 ) # only Windows Mobile 2003 SE or higher
SetBacklight( <battery>,<external> ) # PPC only
ToggleDisplay( <on/off> ) # PPC only
bool   = Screen( "landscape"|"portrait"|"square"|"vga"|"qvga" )
int    = ScreenWidth()
int    = ScreenHeight()
string = CurrentCursor( [<window>] ) # returns "arrow", "wait", "cross", "help", or "uparrow"
RedrawToday
ShowWaitCursor
HideWaitCursor

SetClipText( <text> )
string = GetClipText()

int    = FreeMemory( [BYTES|KB|MB|GB] )  # max. 2147483647
int    = TotalMemory( [BYTES|KB|MB|GB] ) # max. 2147483647

bool   = ExternalPowered()
int    = BatteryPercentage()
int    = BackupBatteryPercentage()
PowerOff
IdleTimerReset # Windows Mobile only

MortScriptType()
string = MortScriptVersion() #similar to FileVersion
GetMortScriptVersion( <variable>,<variable>,<variable>,<variable> ) # similar to GetVersion
value = SystemVersion( [<element>] ) #  element: "major", "minor", "build", "platform", omit for major.minor.build
Reset # Windows Mobile only

If ( <condition> ) { ElseIf ( <condition> ) } [ Else ] EndIf

Choice ( <title>,<message>,<text1>[,<text2>,...] ) # ChoiceDefault ( <title>,<message>,<default>,<timeout>,<text1>,[<text2>,...] ) Case ( <index>[,<index>,...] ) EndChoice

Switch ( <value> ) Case ( <index>[,<index>,...] ) EndSwitch

While ( <condition> ) EndWhile

Repeat ( <count> ) EndRepeat

For <variable> = <value> to <value> [ step <value> ] Next

ForEach <variable> in values ( <value>{,<value>} )	EndForEach
ForEach <variable>[,<variable>] in array ( <array variable> )	EndForEach
ForEach <variable> in split ( <string>,<seperator>,<trim?> )	EndForEach
ForEach <variable> in charsOf ( <string>,<seperator> )	EndForEach
ForEach <variable> in iniSections ( <file/url> )	EndForEach
ForEach <keyVariable>,<valueVariable> in iniKeys ( <file/url>,<section> )	EndForEach
ForEach <variable> in regSubkeys ( <root>, <key> )	EndForEach
ForEach <valueVariable>,<dataVariable> in regValues ( <root>,<key> ) EndForEach
ForEach <variable> in files ( <file/url>,<files> )
ForEach <variable> in directories ( <file/url>,<directories> ) EndForEach


Call( <subroutine> { , <parameter> } )
CallFunction( <subroutine>, <result variable>, { , <parameter> } )

CallScript( <mortscript file (full path!)> { , <parameter> } )
CallScriptFunction( <mortscript file>, <result variable>, { , <parameter> } )

Return( <value> ) (only sets result for Call(Script)# Function, does not leave Sub/Script!

Sub <subroutine>	EndSub

Include( <filename> ) # includes Sub/EndSub blocks of other files

Exit