User Tools

Site Tools


mpl_functions

This is an old revision of the document!


General Functions and Procedures

Function ABS (Num: LongInt) : LongInt

This function takes a signed integer and returns the absolute value. Example:

Var Int : LongInt = -1234

WriteLn('The absolute value of '+Int2str(Int) +' is '+Abs(Int)+'.')

Function ALLOWARROW (Boolean)

Used to turn on arrow key processing in the READKEY function. It is also used outside of MPL so use with caution.

Example:

AllowArrow := True
ReadKey

Function BITCHECK (B : Byte; I : Integer) : Boolean

This function accepts a bit position and checks it against an integer, returning true or false if the bit is on. So for example in the Records, the third bit in UserFlags is UserDeleted:

GetThisUser
If BitCheck(3, UserFlags) Then 
  WriteLn('User is marked deleted');
mpl_functions.1468273986.txt.gz · Last modified: 2016/07/11 16:53 by gryphon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki