This is an old revision of the document!
Table of Contents
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');
Procedure BITSET (B : Byte; I : Integer)
This procedure accepts a bit position and an integer and sets the bit ON/OFF based on a boolean:
GetThisUser BitSet(3, UserFlags, True); // user is marked as deleted
Procedure BITTOGGLE (B : Byte; I : Integer)
This procedure accepts a bit position and an integer and toggles the bit.
GetThisUser BitToggle(3, UserFlags); // undeletes if they are deleted or deletes if // they are not deleted.
Procedure CLRSCR
This function will clear the screen.
Example:
CLRSCR Writeln ('The screen was just cleared.')
The above function will clear the screen and write the text “The screen was just cleared.” to the screen.