# Procedures and Functions

Lists every procedure and function of the runtime library in alphabetical order, each with what it does.

## A

- [Abs](/tB/Modules/Math/Abs.md) -- returns the absolute value of a number
- [AllocMem](/tB/Modules/HiddenModule/AllocMem.md) -- allocates a block of native memory and returns its address
- [AppActivate](/tB/Modules/Interaction/AppActivate.md) -- activates an application window
- [Array](/tB/Modules/Information/Array.md) -- creates a **Variant** array from a comma-separated list of values, or destructures one when used on the left of an assignment
- [Asc, AscB, AscW](/tB/Modules/Strings/Asc.md) -- returns the character code of the first letter in a string
- [Atn](/tB/Modules/Math/Atn.md) -- returns the arctangent of a number

## B

- [Beep](/tB/Modules/Interaction/Beep.md) -- sounds a tone through the computer’s speaker
- [Bin$, Bin](/tB/Modules/Conversion/Bin.md) -- returns a string representing the binary value of a number

## C

- [Calendar](/tB/Modules/DateTime/Calendar.md) -- returns or sets the calendar type (Gregorian or Hijri)
- [CallByDispId](/tB/Modules/Interaction/CallByDispId.md) -- invokes a method or property on an object dynamically by IDispatch dispatch ID
- [ByteSwap](/tB/Modules/Math/ByteSwap.md) -- reverses the order of the bytes in an integral value
- [CallByName](/tB/Modules/Interaction/CallByName.md) -- invokes a method or property on an object dynamically by name
- [CBool](/tB/Modules/Conversion/CBool.md) -- coerces an expression to a **Boolean**
- [CByte](/tB/Modules/Conversion/CByte.md) -- coerces an expression to a **Byte**
- [CCur](/tB/Modules/Conversion/CCur.md) -- coerces an expression to a **Currency**
- [CDate](/tB/Modules/Conversion/CDate.md) -- coerces an expression to a **Date**
- [CDbl](/tB/Modules/Conversion/CDbl.md) -- coerces an expression to a **Double**
- [CDec](/tB/Modules/Conversion/CDec.md) -- coerces an expression to a **Decimal**
- [ChDir](/tB/Modules/FileSystem/ChDir.md) -- changes the current directory or folder
- [ChDrive](/tB/Modules/FileSystem/ChDrive.md) -- changes the current drive
- [CurDir](/tB/Modules/FileSystem/CurDir.md) -- returns the current path
- [Choose](/tB/Modules/Interaction/Choose.md) -- returns one value from a list, selected by 1-based index
- [Chr$, Chr, ChrB$, ChrB, ChrW$, ChrW](/tB/Modules/Strings/Chr.md) -- returns the character associated with a given character code
- [CInt](/tB/Modules/Conversion/CInt.md) -- coerces an expression to an **Integer**
- [CLng](/tB/Modules/Conversion/CLng.md) -- coerces an expression to a **Long**
- [CLngLng](/tB/Modules/Conversion/CLngLng.md) -- coerces an expression to a **LongLong**
- [CLngPtr](/tB/Modules/Conversion/CLngPtr.md) -- coerces an expression to a **LongPtr**
- [Command$, Command](/tB/Modules/Interaction/Command.md) -- returns the command-line arguments passed to the program
- [CompilerVersion](/tB/Modules/Compilation/CompilerVersion.md) -- returns the twinBASIC compiler version number
- [ConvertIconToBitmap](/tB/Modules/HiddenModule/ConvertIconToBitmap.md) -- converts an icon picture to a bitmap picture
- [Cos](/tB/Modules/Math/Cos.md) -- returns the cosine of an angle
- [CreateGUID](/tB/Modules/HiddenModule/CreateGUID.md) -- generates a fresh GUID and returns it as a string
- [CreateObject](/tB/Modules/Interaction/CreateObject.md) -- creates a new instance of a COM/Automation object
- [CreateStdPictureFromHandle](/tB/Modules/HiddenModule/CreateStdPictureFromHandle.md) -- wraps a GDI bitmap or icon handle in an **stdole.StdPicture**
- [CSng](/tB/Modules/Conversion/CSng.md) -- coerces an expression to a **Single**
- [CStr](/tB/Modules/Conversion/CStr.md) -- coerces an expression to a **String**
- [CType](/tB/Modules/Conversion/CType.md) -- generic type conversion supporting the **CType(Of *type*)** cast operator
- [CurrentComponentCLSID](/tB/Modules/Compilation/CurrentComponentCLSID.md) -- returns the Class ID (CLSID) of the current class
- [CurrentComponentName](/tB/Modules/Compilation/CurrentComponentName.md) -- returns the name of the current component (module or class)
- [CurrentProcedureName](/tB/Modules/Compilation/CurrentProcedureName.md) -- returns the name of the procedure in which the function is called
- [CurrentProjectName](/tB/Modules/Compilation/CurrentProjectName.md) -- returns the name of the current project
- [CurrentSourceFile](/tB/Modules/Compilation/CurrentSourceFile.md) -- returns the full path of the current source file
- [CVar](/tB/Modules/Conversion/CVar.md) -- coerces an expression to a **Variant**
- [CVDate](/tB/Modules/Conversion/CVDate.md) -- coerces an expression to a **Variant** of subtype **Date**
- [CVErr](/tB/Modules/Conversion/CVErr.md) -- coerces a numeric expression to a **Variant** of subtype **Error**

## D

- [Date](/tB/Modules/DateTime/Date.md) -- sets or returns the current system date
- [DateAdd](/tB/Modules/DateTime/DateAdd.md) -- adds a time interval to a date
- [DateDiff](/tB/Modules/DateTime/DateDiff.md) -- returns the number of time intervals between two dates
- [DatePart](/tB/Modules/DateTime/DatePart.md) -- returns a specified part of a given date
- [DateSerial](/tB/Modules/DateTime/DateSerial.md) -- returns a date for a specified year, month, and day
- [DateValue](/tB/Modules/DateTime/DateValue.md) -- converts a string to a date
- [Day](/tB/Modules/DateTime/Day.md) -- returns the day of the month from a date value
- [DDB](/tB/Modules/Financial/DDB.md) -- returns the depreciation of an asset via the double-declining balance method
- [DeleteSetting](/tB/Modules/Interaction/DeleteSetting.md) -- deletes a section or key setting from an application’s entry in the Windows registry
- [Dir](/tB/Modules/FileSystem/Dir.md) -- returns the name of a file, directory, folder, or volume label that matches a pattern
- [DoEvents](/tB/Modules/Interaction/DoEvents.md) -- yields control to the message loop so pending events can be processed

## E

- [Emit](/tB/Modules/HiddenModule/Emit.md) -- injects custom **Byte** values into the codegen stream of the enclosing procedure
- [EmitAny](/tB/Modules/HiddenModule/EmitAny.md) -- injects custom typed values into the codegen stream of the enclosing procedure
- [Environ$, Environ](/tB/Modules/Interaction/Environ.md) -- returns the value of a process environment variable
- [EOF](/tB/Modules/FileSystem/EOF.md) -- returns whether the end of a file has been reached
- [Erl](/tB/Modules/Information/Erl.md) -- returns the line number where the most recent run-time error occurred
- [Err](/tB/Modules/Information/Err.md) -- returns the **ErrObject** describing the current run-time error state
- [Error$, Error](/tB/Modules/Conversion/Error.md) -- returns the error message that corresponds to a given error number
- [Eval](/tB/Modules/HiddenModule/Eval.md) -- compiles and evaluates a twinBASIC expression supplied as a string
- [Exp](/tB/Modules/Math/Exp.md) -- returns *e* (the base of natural logarithms) raised to a power

## F

- [FileAttr](/tB/Modules/FileSystem/FileAttr.md) -- returns the file mode for files opened with the **Open** statement
- [FileCopy](/tB/Modules/FileSystem/FileCopy.md) -- copies a file
- [FileDateTime](/tB/Modules/FileSystem/FileDateTime.md) -- returns the date and time when a file was created or last modified
- [FileLen](/tB/Modules/FileSystem/FileLen.md) -- returns the length of a file in bytes
- [Filter](/tB/Modules/Strings/Filter.md) -- filters a string array into a subset according to criteria
- [Fix](/tB/Modules/Conversion/Fix.md) -- returns the integer portion of a number, truncating toward zero
- [Format$, Format](/tB/Modules/Strings/Format.md) -- formats an expression according to instructions contained in a format expression
- [FormatCurrency](/tB/Modules/Strings/FormatCurrency.md) -- formats an expression as a currency value
- [FormatDateTime](/tB/Modules/Strings/FormatDateTime.md) -- formats an expression as a date or time
- [FormatNumber](/tB/Modules/Strings/FormatNumber.md) -- formats an expression as a number
- [FormatPercent](/tB/Modules/Strings/FormatPercent.md) -- formats an expression as a percentage
- [FreeFile](/tB/Modules/FileSystem/FreeFile.md) -- returns the next file number available for use by the **Open** statement
- [FreeMem](/tB/Modules/HiddenModule/FreeMem.md) -- frees memory allocated with **AllocMem**
- [FV](/tB/Modules/Financial/FV.md) -- returns the future value of an annuity based on periodic fixed payments and a fixed interest rate

## G

- [GetAllSettings](/tB/Modules/Interaction/GetAllSettings.md) -- returns every key/value pair in a section of an application's registry entry
- [GetAttr](/tB/Modules/FileSystem/GetAttr.md) -- returns the attributes of a file or directory
- [GetMem1](/tB/Modules/HiddenModule/GetMem1.md) -- reads one byte from a memory address into a **Byte** variable
- [GetMem2](/tB/Modules/HiddenModule/GetMem2.md) -- reads two bytes from a memory address into an **Integer** variable
- [GetMem4](/tB/Modules/HiddenModule/GetMem4.md) -- reads four bytes from a memory address into a **Long** variable
- [GetMem8](/tB/Modules/HiddenModule/GetMem8.md) -- reads eight bytes from a memory address into a **Currency** variable
- [GetMemPtr](/tB/Modules/HiddenModule/GetMemPtr.md) -- reads a pointer-sized value from a memory address into a **LongPtr** variable
- [GetObject](/tB/Modules/Interaction/GetObject.md) -- returns a reference to an Automation object loaded from a file or already running
- [GetSetting](/tB/Modules/Interaction/GetSetting.md) -- returns a string key setting value from an application’s entry in the Windows registry

## H

- [Hex$, Hex](/tB/Modules/Conversion/Hex.md) -- returns a string representing the hexadecimal value of a number
- [Hour](/tB/Modules/DateTime/Hour.md) -- returns the hour of the day from a time value

## I

- [If](/tB/Modules/Interaction/If.md) -- evaluates an expression and returns one of two values, with short-circuit evaluation
- [IIf](/tB/Modules/Interaction/IIf.md) -- evaluates an expression and returns one of two values; both branches are always evaluated
- [IMEStatus](/tB/Modules/Information/IMEStatus.md) -- returns the status of the Input Method Editor
- [Input, Input$](/tB/Modules/FileSystem/Input.md) -- reads a fixed number of characters from an open sequential file
- [InputB, InputB$](/tB/Modules/FileSystem/InputB.md) -- reads a fixed number of bytes from an open sequential file
- [InputBox](/tB/Modules/Interaction/InputBox.md) -- prompts the user for a line of text and returns what was entered
- [InStr$, InStrB, InStr](/tB/Modules/Strings/InStr.md) -- returns the position of one string within another
- [InStrRev](/tB/Modules/Strings/InStrRev.md) -- returns the position of one string within another, searching from the end
- [Int](/tB/Modules/Conversion/Int.md) -- returns the integer portion of a number, rounding toward negative infinity
- [IPmt](/tB/Modules/Financial/IPmt.md) -- returns the interest payment for a given period of an annuity
- [IRR](/tB/Modules/Financial/IRR.md) -- returns the internal rate of return for a series of periodic cash flows
- [IsArray](/tB/Modules/Information/IsArray.md) -- returns whether a variable is an array
- [IsArrayInitialized](/tB/Modules/Information/IsArrayInitialized.md) -- returns whether an array has been dimensioned
- [IsDate](/tB/Modules/Information/IsDate.md) -- returns whether an expression can be evaluated as a date
- [IsEmpty](/tB/Modules/Information/IsEmpty.md) -- returns whether a **Variant** is uninitialised
- [IsError](/tB/Modules/Information/IsError.md) -- returns whether an expression is an error subtype
- [IsMissing](/tB/Modules/Information/IsMissing.md) -- returns whether an optional argument was supplied
- [IsNull](/tB/Modules/Information/IsNull.md) -- returns whether a variable contains a **Null** value
- [IsNumeric](/tB/Modules/Information/IsNumeric.md) -- returns whether an expression can be evaluated as a number
- [IsObject](/tB/Modules/Information/IsObject.md) -- returns whether a variable refers to an object

## J

- [Join](/tB/Modules/Strings/Join.md) -- concatenates a string array using a given delimiter

## K

- [Kill](/tB/Modules/FileSystem/Kill.md) -- deletes files from a disk

## L

- [LBound](/tB/Modules/Information/LBound.md) -- returns the smallest valid subscript for a dimension of an array
- [LCase$, LCase](/tB/Modules/Strings/LCase.md) -- returns a string converted to lowercase
- [Left$, Left, LeftB$, LeftB](/tB/Modules/Strings/Left.md) -- returns the leftmost characters from a string
- [Len, LenB](/tB/Modules/Strings/Len.md) -- returns the length of a string, or the storage size of a variable
- [Load](/tB/Core/Load.md) -- loads an object (typically a form) into memory without showing it
- [Loc](/tB/Modules/FileSystem/Loc.md) -- returns the current read/write position within an open file
- [LOF](/tB/Modules/FileSystem/LOF.md) -- returns the size, in bytes, of an open file
- [Log](/tB/Modules/Math/Log.md) -- returns the natural (base *e*) logarithm of a number
- [LTrim$, LTrim](/tB/Modules/Strings/LTrim.md) -- removes leading spaces from a string

## M

- [MacID](/tB/Modules/Conversion/MacID.md) -- on the Macintosh, converts a 4-character constant to a value usable by **Dir**, **Kill**, **Shell**, or **AppActivate**
- [Mid$, Mid, MidB$, MidB](/tB/Modules/Strings/Mid.md) -- returns a substring of a string
- [Minute](/tB/Modules/DateTime/Minute.md) -- returns the minute of the hour from a time value
- [MIRR](/tB/Modules/Financial/MIRR.md) -- returns the modified internal rate of return for a series of periodic cash flows
- [MkDir](/tB/Modules/FileSystem/MkDir.md) -- creates a new directory or folder
- [Month](/tB/Modules/DateTime/Month.md) -- returns the month of the year from a date value
- [MonthName](/tB/Modules/Strings/MonthName.md) -- returns the name of the specified month
- [MsgBox](/tB/Modules/Interaction/MsgBox.md) -- displays a modal message dialog and returns the button the user clicked

## N

- [Name](/tB/Core/Name.md) -- renames a disk file, directory, or folder
- [NPer](/tB/Modules/Financial/NPer.md) -- returns the number of periods for an annuity based on periodic fixed payments and a fixed interest rate
- [NPV](/tB/Modules/Financial/NPV.md) -- returns the net present value of an investment based on a series of periodic cash flows and a discount rate
- [Now](/tB/Modules/DateTime/Now.md) -- returns the current system date and time
- [Nz](/tB/Modules/Conversion/Nz.md) -- replaces a **Null** value with a specified replacement value

## O

- [ObjPtr](/tB/Modules/Information/ObjPtr.md) -- returns the COM-identity address of an object
- [Oct$, Oct](/tB/Modules/Conversion/Oct.md) -- returns a string representing the octal value of a number

## P

- [Partition](/tB/Modules/Interaction/Partition.md) -- returns a string identifying the range a number falls into
- [PictureToByteArray](/tB/Modules/HiddenModule/PictureToByteArray.md) -- serialises an **IPicture** into a **Byte** array
- [Pmt](/tB/Modules/Financial/Pmt.md) -- returns the payment for an annuity based on periodic fixed payments and a fixed interest rate
- [PPmt](/tB/Modules/Financial/PPmt.md) -- returns the principal payment for a given period of an annuity
- [ProcessorArchitecture](/tB/Modules/Compilation/ProcessorArchitecture.md) -- returns the processor architecture of the running application
- [PutMem1](/tB/Modules/HiddenModule/PutMem1.md) -- writes one byte to a memory address
- [PutMem2](/tB/Modules/HiddenModule/PutMem2.md) -- writes two bytes to a memory address
- [PutMem4](/tB/Modules/HiddenModule/PutMem4.md) -- writes four bytes to a memory address
- [PutMem8](/tB/Modules/HiddenModule/PutMem8.md) -- writes eight bytes to a memory address
- [PutMemPtr](/tB/Modules/HiddenModule/PutMemPtr.md) -- writes a pointer-sized value to a memory address
- [PV](/tB/Modules/Financial/PV.md) -- returns the present value of an annuity based on periodic fixed payments and a fixed interest rate

## Q

- [QBColor](/tB/Modules/Information/QBColor.md) -- returns the RGB colour value for a QuickBASIC colour index

## R

- [RaiseEventByName](/tB/Modules/Interaction/RaiseEventByName.md) -- raises an event by name on an object, taking arguments as a **Variant** array
- [RaiseEventByName2](/tB/Modules/Interaction/RaiseEventByName2.md) -- raises an event by name on an object, taking a variable-length argument list
- [Randomize](/tB/Modules/Math/Randomize.md) -- initializes the random-number generator
- [Rate](/tB/Modules/Financial/Rate.md) -- returns the interest rate per period for an annuity
- [Replace](/tB/Modules/Strings/Replace.md) -- replaces a substring within a string with another substring
- [Reset](/tB/Modules/FileSystem/Reset.md) -- closes all disk files opened by using the **Open** statement
- [RGB](/tB/Modules/Information/RGB.md) -- builds an RGB colour value from red, green, and blue components
- [RGBA](/tB/Modules/Information/RGBA.md) -- builds an RGBA colour value from red, green, blue, and alpha components
- [RGBA_A](/tB/Modules/Information/RGBA_A.md) -- returns the alpha component of an RGBA colour value
- [RGB_B](/tB/Modules/Information/RGB_B.md) -- returns the blue component of an RGB colour value
- [RGB_G](/tB/Modules/Information/RGB_G.md) -- returns the green component of an RGB colour value
- [RGB_R](/tB/Modules/Information/RGB_R.md) -- returns the red component of an RGB colour value
- [Right$, Right, RightB$, RightB](/tB/Modules/Strings/Right.md) -- returns the rightmost characters from a string
- [RmDir](/tB/Modules/FileSystem/RmDir.md) -- removes an existing directory or folder
- [Rnd](/tB/Modules/Math/Rnd.md) -- returns a pseudo-random number in the range [0.0, 1.0)
- [Round](/tB/Modules/Math/Round.md) -- rounds a number to a specified number of decimal places
- [RTrim$, RTrim](/tB/Modules/Strings/RTrim.md) -- removes trailing spaces from a string

## S

- [SavePicture](/tB/Core/SavePicture.md) -- saves a graphic from a **Picture** or **Image** to a file
- [SaveSetting](/tB/Modules/Interaction/SaveSetting.md) -- saves or creates an application entry in the application’s entry in the Windows registry
- [Second](/tB/Modules/DateTime/Second.md) -- returns the second of the minute from a time value
- [Seek](/tB/Modules/FileSystem/Seek.md) -- returns or sets the read/write position within an open file
- [SendKeys](/tB/Modules/Interaction/SendKeys.md) -- sends keystrokes to the active window
- [SetAttr](/tB/Modules/FileSystem/SetAttr.md) -- sets attribute information for a file
- [Sgn](/tB/Modules/Math/Sgn.md) -- returns a value indicating the sign of a number
- [ShiftRotateLeft](/tB/Modules/Math/ShiftRotateLeft.md) -- rotates the bits of an integral value left
- [ShiftRotateRight](/tB/Modules/Math/ShiftRotateRight.md) -- rotates the bits of an integral value right
- [ShiftUnsignedRight](/tB/Modules/Math/ShiftUnsignedRight.md) -- shifts the bits of an integral value right, filling with zeros
- [Shell](/tB/Modules/Interaction/Shell.md) -- runs another program asynchronously and returns its task ID
- [Sin](/tB/Modules/Math/Sin.md) -- returns the sine of an angle
- [SLN](/tB/Modules/Financial/SLN.md) -- returns the straight-line depreciation of an asset for a single period
- [Space$, Space](/tB/Modules/Strings/Space.md) -- returns a string of spaces
- [Split](/tB/Modules/Strings/Split.md) -- splits a string into a string array
- [Sqr](/tB/Modules/Math/Sqr.md) -- returns the square root of a number
- [Str$, Str](/tB/Modules/Conversion/Str.md) -- returns the string representation of a number
- [StrComp](/tB/Modules/Strings/StrComp.md) -- compares two strings
- [StrConv](/tB/Modules/Strings/StrConv.md) -- converts a string to a specified format
- [String$, String](/tB/Modules/Strings/String.md) -- returns a string of repeating characters
- [StrPtr](/tB/Modules/Information/StrPtr.md) -- returns the address of the underlying buffer of a **String**
- [StrReverse](/tB/Modules/Strings/StrReverse.md) -- reverses the order of characters in a string
- [Switch](/tB/Modules/Interaction/Switch.md) -- returns the value paired with the first **True** condition in a list of (condition, value) pairs
- [SYD](/tB/Modules/Financial/SYD.md) -- returns the sum-of-years' digits depreciation of an asset for a specified period

## T

- [Tan](/tB/Modules/Math/Tan.md) -- returns the tangent of an angle
- [Time](/tB/Modules/DateTime/Time.md) -- sets or returns the current system time
- [Timer](/tB/Modules/DateTime/Timer.md) -- returns the number of seconds elapsed since midnight
- [TimeSerial](/tB/Modules/DateTime/TimeSerial.md) -- returns a time for a specific hour, minute, and second
- [TimeValue](/tB/Modules/DateTime/TimeValue.md) -- converts a string to a time
- [TranslateColor](/tB/Modules/Information/TranslateColor.md) -- translates an OLE colour value to a plain RGB colour value
- [Trim$, Trim](/tB/Modules/Strings/Trim.md) -- removes leading and trailing spaces from a string
- [TypeName](/tB/Modules/Information/TypeName.md) -- returns the name of a variable's data type as a **String**

## U

- [UBound](/tB/Modules/Information/UBound.md) -- returns the largest valid subscript for a dimension of an array
- [UCase$, UCase](/tB/Modules/Strings/UCase.md) -- returns a string converted to uppercase
- [UnrollLoop](/tB/Modules/Compilation/UnrollLoop.md) -- asks the LLVM compiler to unroll the loop that contains it
- [Unload](/tB/Core/Unload.md) -- removes an object (typically a form) from memory

## V

- [Val](/tB/Modules/Conversion/Val.md) -- parses a string into a **Double**
- [ValDec](/tB/Modules/Conversion/ValDec.md) -- parses a string into a **Decimal**
- [VarPtr](/tB/Modules/Information/VarPtr.md) -- returns the address of a variable
- [VarType](/tB/Modules/Information/VarType.md) -- returns the **VbVarType** enumeration value identifying a variable's subtype
- [vbaCastObj](/tB/Modules/HiddenModule/vbaCastObj.md) -- returns an object reinterpreted as another COM interface
- [vbaCopyBytes](/tB/Modules/HiddenModule/vbaCopyBytes.md) -- copies a block of bytes from one address to another
- [vbaCopyBytesZero](/tB/Modules/HiddenModule/vbaCopyBytesZero.md) -- copies a block of bytes from one address to another, then zeros the source
- [vbaObjAddref](/tB/Modules/HiddenModule/vbaObjAddref.md) -- increments the COM reference count of an object at a given address
- [vbaObjSet](/tB/Modules/HiddenModule/vbaObjSet.md) -- assigns an object pointer to an object variable, releasing any prior reference
- [vbaObjSetAddref](/tB/Modules/HiddenModule/vbaObjSetAddref.md) -- assigns an object pointer to an object variable, adding a reference and releasing any prior reference

## W

- [Weekday](/tB/Modules/DateTime/Weekday.md) -- returns the day of the week from a date value
- [WeekdayName](/tB/Modules/Strings/WeekdayName.md) -- returns the name of the specified day of the week
- [Width](/tB/Modules/FileSystem/Width.md) -- sets the line width for a sequential output file

## X

## Y

- [Year](/tB/Modules/DateTime/Year.md) -- returns the year from a date value

## Z