Skip to content

Procedures and Functions

A

  • Abs -- returns the absolute value of a number
  • AllocMem -- allocates a block of native memory and returns its address
  • AppActivate -- activates an application window
  • Array -- 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 -- returns the character code of the first letter in a string
  • Atn -- returns the arctangent of a number

B

  • Beep -- sounds a tone through the computer’s speaker

C

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

D

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

E

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

F

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

G

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

H

  • Hex$, Hex -- returns a string representing the hexadecimal value of a number
  • Hour -- returns the hour of the day from a time value

I

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

J

  • Join -- concatenates a string array using a given delimiter

K

  • Kill -- deletes files from a disk

L

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

M

  • MacID -- on the Macintosh, converts a 4-character constant to a value usable by Dir, Kill, Shell, or AppActivate
  • Mid$, Mid, MidB$, MidB -- returns a substring of a string
  • Minute -- returns the minute of the hour from a time value
  • MIRR -- returns the modified internal rate of return for a series of periodic cash flows
  • MkDir -- creates a new directory or folder
  • Month -- returns the month of the year from a date value
  • MonthName -- returns the name of the specified month
  • MsgBox -- displays a modal message dialog and returns the button the user clicked

N

  • Name -- renames a disk file, directory, or folder
  • NPer -- returns the number of periods for an annuity based on periodic fixed payments and a fixed interest rate
  • NPV -- returns the net present value of an investment based on a series of periodic cash flows and a discount rate
  • Now -- returns the current system date and time
  • Nz -- replaces a Null value with a specified replacement value

O

  • ObjPtr -- returns the COM-identity address of an object
  • Oct$, Oct -- returns a string representing the octal value of a number

P

  • Partition -- returns a string identifying the range a number falls into
  • PictureToByteArray -- serialises an IPicture into a Byte array
  • Pmt -- returns the payment for an annuity based on periodic fixed payments and a fixed interest rate
  • PPmt -- returns the principal payment for a given period of an annuity
  • ProcessorArchitecture -- returns the processor architecture of the running application
  • PutMem1 -- writes one byte to a memory address
  • PutMem2 -- writes two bytes to a memory address
  • PutMem4 -- writes four bytes to a memory address
  • PutMem8 -- writes eight bytes to a memory address
  • PutMemPtr -- writes a pointer-sized value to a memory address
  • PV -- returns the present value of an annuity based on periodic fixed payments and a fixed interest rate

Q

  • QBColor -- returns the RGB colour value for a QuickBASIC colour index

R

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

S

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

T

  • Tan -- returns the tangent of an angle
  • Time -- sets or returns the current system time
  • Timer -- returns the number of seconds elapsed since midnight
  • TimeSerial -- returns a time for a specific hour, minute, and second
  • TimeValue -- converts a string to a time
  • TranslateColor -- translates an OLE colour value to a plain RGB colour value
  • Trim$, Trim -- removes leading and trailing spaces from a string
  • TypeName -- returns the name of a variable's data type as a String

U

  • UBound -- returns the largest valid subscript for a dimension of an array
  • UCase$, UCase -- returns a string converted to uppercase
  • Unload -- removes an object (typically a form) from memory

V

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

W

  • Weekday -- returns the day of the week from a date value
  • WeekdayName -- returns the name of the specified day of the week
  • Width -- sets the line width for a sequential output file

X

Y

  • Year -- returns the year from a date value

Z

twinBASIC and LOGO copyright of "WaynePhillipsEA" author