MPL Documentation

System Unit/Core Language

Every programming language has reserved keywords, these make the base grammar/language.

Directive Description
 allocmem  calls getmem, and initialized the memory to all byte zero
 append  open a text file, to append text to the file
 applicationname  contains the full path and filename to the current script
 arrayavg  returns the average of an array of longint
 arrayconcat  merges array1 and array2, either TLongintArray or TStringArray
 arrayindexof  returns the index of parameter1 in parameter2 TLonginArray or TStringArray
 arrayjoin  returns a comma delimited string of TLongintArray or TStringArray
 arraymax  returns the highest value of TLongintArray
 arraymin  returns the lowest value of TLongintArray
 arraypop  removes the last element from the array and returns the element
 arraypush  appends the element to the end of TLongintArray or TStringArray
 arrayshift  removed the first element from the array and returns the element
 arraysum  sums the elements of the array
 assert  provides an opportunity to intercept an unexpected condition and halt
 assigned  checks to see if a reference is not nil
 assignfile  assigns a value to binary file handle for a filename in preparation for reading or writing
 assigntext  assigns a value to text file handle for a filename in preparation for reading or writing
 between  checks if param1 is greater or equal param2 and less than or equal to param3
 blockread  used to read data (bytes or records) from a binary file
 blockwrite  used to write data (bytes or records) to a binary file
 boolasstr  returns your string for true and false for the boolean parameter
 booltostr  returns the string 'True' or 'False' for the boolean parameter
 charcount  returns the count for the number of instances a character is in a string
 chr  typecast an ordinal 8bit byte to its ASCII character counter part
 cleanstr  returns a string filtered from high bit and control characters, with replacement letters
 closefile  closes a binary file, flushing the handle and assigns it to nil
 closetext  closes a text file, flushing the handle and assigns it to nil
 copy  returns 1 or more characters from a string, passing start position and up-to length
 currtostr  returns a string for the currency value parameter, without the currency sign
 datetimetounix  used to convert the borland tdatetime parameter to unix int64 timestamp
 dec  decrements the parameter by one or more if a second parameter is passed for how many
 delete  deletes characters from a string, starting at param2 and up-to length param3
 deletefile  physically delete/unlink the filename parameter from the file system
 endoffile  returns true is the file handle has reached the end of the binary file
 endoftext  returns true is the file handle has reached the end of the text file
 erasefile  physically delete/unlink the filename associated to the binary file handle from the file system
 erasetext  physically delete/unlink the filename associated to the text file handle from the file system
 floattocommastr  returns a string for the float value parameter, with comma denoting the thousands, etc.
 filepos  returns the current byte position of the binary file handle
 filesize  returns the total byte size of the filename associated with the binary file handle
 fillbyte  speed fill param1 with the same byte up-to the length
 fillchar  speed fill param1 with the same character up-to the length
 fillmem  same as fillbyte except parameter 1 is a pointer to any type
 floattostr  returns a string for the float value parameter without comma or prefix
 flushfiles  flushes any buffers from standard file descriptors such as standard input and output
 flushtext  text file handles use memory buffers, this forces the memory to write to disk on a text file
 freemem  unallocate the memory associate with param1, which use getmem to allocate it originally
 getcurrentdir  returns the current folder you application is set to read and write files
 getcurrentpath  returns the current folder you application is set to read and write files (alias to getcurrentdir)
 getmem  if available allocate the requested amount of memory and return a pointer to it
 getprocedureaddress  when working with dynamically linked files, this gets the memory address for a method
 getprocessid  this returns the current process id for your application
 getthreadid  this returns the current thread id for the main thread of your application
 glock  this attempts a global lock (semaphore) used across all threads in coderunner
 gunlock  this releases a previous call to glock in coderunner
 halt  this terminates your application and the host (do not use in coderunner applications)
 hextoint  returns the integer value for the hexadecimal parameter
 hextostr  returns a string for the hexadecimal parameter
 hi  returns the hi nibble (4 bits) of a byte
 high  returns the max or top of a dynamic parameter like arrays
 inc  increment param1 by one or more if param2 is passed
 insert  inserts string Source in string S, at position Index, shifting all characters after Index to the right
 inttobin  returns a binary (string of 0's and 1's) representing the integer parameter
 inttocommastr  returns a string with commas at the thousands (etc), for the integer parameter
 inttohex  returns the hexadecimal string (0 to F) representing the integer parameter
 inttooct  returns the octal string (0 to 7) representing the integer parameter
 inttostr  returns a string representing the integer parameter
 ioresult  return result code of last file IO operation, 0 means success, resets upon call
 lastoserror  return the last Operating System error code, does not reset upon call
 left  returns a string of param1 of up-to param2 length
 length  returns the integer value of the number of bytes/chars/elements of param1
 lengthasstring  expands or shrinks the number of elements/bytes/chars of param1
 lo  returns the lo nibble (4 bits) of the byte parameter
 loadlibrary  loads a dynamically linked file into memory to access its methods at run-time
 low  returns the low end or starting number of a dynamic variable like an array
 lowercase  returns a string with param1 string all lowercase
 max  returns the higher value of the two integer parameters
 mid  returns 1 or more characters from a string, passing start position and up-to length (alias to copy)
 min  returns the lower value of the two integer parameters
 minandmax  returns the lowest value and highest value of a dynamic array
 minnotzero  returns the lowest value greater than zero of the two integer parameters
 move  move data from one location in memory to another, up-to length
 null  
 odd  
 ord  
 paramcount  
 paramstr  
 parseint  
 pos  
 posstringarray  
 pred  
 raiseexception  
 readln  
 readlntext  
 reallocmem  
 renamefile  
 renametext  
 reset  
 rewrite  
 right  
 seekfile  
 seekeof  
 setcurrentdir  
 setcurrentpath  
 setlength  
 sizeof  
 str  
 stringreplace  
 strtobool  
 strtobooldef  
 strtocommastr  
 strtocurr  
 strtocurrdef  
 strtofloat  
 strtofloatdef  
 strtohex  
 strtoint  
 strtoint64  
 strtoint64def  
 strtointdef  
 strtouint64  
 strtouint64def  
 succ  
 swap  
 swapendian  
 timestamp  
 truncate  
 uniquestring  
 unixtodatetime  
 unloadlibrary  
 uppercase  
 uppercase  
 val  
 write  
 writeln  
 writetext  
 writelntext  
 yield  waits a specified number of seconds, relaxing to other threads and processes.