mpl_functions
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mpl_functions [2016/07/11 16:50] – created gryphon | mpl_functions [2016/07/18 08:38] (current) – [Function DATEJ2G (LI : LongInt) : String] gryphon | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== General Functions and Procedures ====== | ====== 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(' | ||
+ | ==== Function ALLOWARROW (Boolean) ==== | ||
+ | |||
+ | Used to turn on arrow key processing in the READKEY function. | ||
+ | |||
+ | 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(' | ||
+ | ==== Procedure | ||
+ | |||
+ | This procedure accepts a bit position and an integer and sets the bit ON/OFF based on a boolean: | ||
+ | |||
+ | GetThisUser | ||
+ | BitSet(3, UserFlags, True); | ||
+ | |||
+ | ==== Procedure BITTOGGLE (B : Byte; I : Integer) ==== | ||
+ | This procedure accepts a bit position and an integer and toggles the bit. | ||
+ | |||
+ | GetThisUser | ||
+ | BitToggle(3, | ||
+ | // 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." | ||
+ | ==== Function DATE2DOS (Str : String) : LongInt ==== | ||
+ | |||
+ | This function takes a MM/DD/YY format date and converts it to DOS packed datetime format. | ||
+ | |||
+ | Var DStr : String = ' | ||
+ | Var PDt : LongInt | ||
+ | | ||
+ | PDt := Date2Dos(DStr) | ||
+ | |||
+ | ==== Function DATE2JULIAN (Str : String) : LongInt ==== | ||
+ | |||
+ | This function takes a MM/DD/YY format date and converts it to a Julian date format. | ||
+ | |||
+ | ==== Function DATEG2J (Str : String) : LongInt ==== | ||
+ | |||
+ | This function takes a gregorian date format (MMDDYY) and converts it to a Julian format | ||
+ | |||
+ | ==== Function DATEJ2G (LI : LongInt) : String ==== | ||
+ | |||
+ | This function takes a julian date format and converts it to a gregorian format (MMDDYY). | ||
+ | ==== Procedure GOTOXY (X: Byte, Y:Byte) ==== | ||
+ | |||
+ | This procedure will move the cursor to a specified X and Y position on the screen. | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | CLRSCR | ||
+ | GotoXY (1, 10) | ||
+ | WriteLn (' | ||
+ | </ | ||
+ | The above example will clear the screen then goto the first column of the tenth line and output the text " | ||
+ | |||
+ | |||
+ | ==== Procedure HALT ==== | ||
+ | |||
+ | This procedure will exit the program and return the user back to the BBS immediately. | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | If Graphics = 0 Do | ||
+ | Begin | ||
+ | WriteLn (' | ||
+ | Halt | ||
+ | End | ||
+ | </ | ||
+ | The above example will check to see if the user has ANSI graphics and if not, display " | ||
+ | |||
+ | ==== Function INITIALS (String) : String ==== | ||
+ | |||
+ | This function takes a user name and attempts to return one or two character initials. | ||
+ | < | ||
+ | S := Initials(' | ||
+ | </ | ||
+ | |||
+ | ==== Function INPUT (Field: Byte, Max: Byte, Mode: Byte, Default: string) : String ==== | ||
+ | |||
+ | This function gives input to the user, and returns the result of the input as a string variable. | ||
+ | |||
+ | The Field parameter is the size of the input field (in characters) that the user will be able to see. If the field size is smaller than the maximum number of characters allowed in the input, the input line will scroll when the user reaches the end. This field is usually set to the same as the Max parameter. | ||
+ | |||
+ | The Max parameter is the maximum number of characters that Input will allow to be entered. | ||
+ | |||
+ | The Mode parameter is the type of input that will be accepted, and can be any one of the following input types: | ||
+ | ^Mode^Description^Coments^ | ||
+ | |1|Standard input.|All characters allowed.| | ||
+ | |2|Upper case input.|Allows all characters, but will convert any lower case letters into upper case.| | ||
+ | |3|Proper input.|Allows all characters, but will convert the first letter in each word to an upper case letter.| | ||
+ | |4|Phone input.|Allows only numbers and will pre-format them using the USA-style phone numbers. | ||
+ | |5|Date input.|Allows only numbers and will pre-format them using the date format (ie XX/XX/XX) that is currently selected by the user. NOTE: The date input will always return the date in the MM/DD/YY format, regardless of what format the user has selected. | ||
+ | |6|Password input.|Allows all characters, but will convert any lower case letters into upper case. The character that is typed is NOT echoed to the screen. | ||
+ | |7|Lower case input.|Allows all characters, but will convert any lower case letters into upper case.| | ||
+ | |8|User Defined.|User name format from sys config| | ||
+ | |9|Standard Input w/o CRLF|Will not append CRLF to input| | ||
+ | |10|Numeric Input.|Will only accept number 0-9 and . , + -| | ||
+ | |||
+ | NOTE: If any of the above input values are increased by 10, Input will create an input field using the foreground/ | ||
+ | |||
+ | The Default parameter can be used to force a default text into the input field. | ||
+ | |||
+ | Example: | ||
+ | < | ||
+ | Var Str : String | ||
+ | |||
+ | Write (' | ||
+ | Str := Input (30, 30, 1, '' | ||
+ | </ | ||
+ | The above example will print the text "Enter something: " to the screen and the allow input of up to 30 characters | ||
+ | < | ||
+ | Var Str : String | ||
+ | |||
+ | Write (' | ||
+ | Str := Input (30, 30, 11, ' | ||
+ | </ | ||
+ | The above example will function just like the first example, except it will create an input field background and stuff the text of " | ||
+ |
mpl_functions.1468273850.txt.gz · Last modified: 2016/07/11 16:50 by gryphon