This chapter lists the global statements and procedures that form the core of the twinBASIC language.

Warning

Work in Progress Below

Categorical List

Compiler Control

Declarations and Definitions

  • Class, Module - define a class or module
  • Sub - define a procedure
  • Function - define a function
  • Property - define a property
  • Enum - define an enumeration type with associated constants
  • Type - declare a user-defined data type (UDT)/a structure
  • Declare - declare an external/library procedure or function
  • Event - declare an event
  • Implements - specifies that a class implements a given interface
  • End - terminate execution, finish a Function, Sub, Property, or Enum definition, finish a Type declaration; finish a Class or Module, finish an If, Select, or With block

Flow Control

Statements:

See also:

  • End - terminate execution.

Variable Declaration

Statements:

  • Dim - declare a typed scalar or array variable
  • Const - declare a constant
  • Public - declare a public variable in a class or module
  • Private - declare a private variable in a class or module
  • Static - declare a a variable of static duration

See also:

  • Erase - clear/fill an array
  • ReDim - change the size of an array

Variable Assignment and Modification

Statements:

  • Let - sets the value of a variable
  • Set - changes the object referred by the variable
  • Erase - fills a fixed-size array with default values, or invalidates a dynamic array
  • LSet - assigns a user-defined type, or left-aligns a string
  • RSet - right-aligns a string
  • ReDim - change the size of a dynamically-sized array,

File I/O

Statements:

  • Open, Close - open/close a file for I/O operations
  • Get, Put - read/write data from an open random access file
  • Line Input, Print - read/write a line from/to an open text file
  • Input, Write - read/write data from an open sequential access file
  • Seek - change the current access position in an open file
  • Lock, Unlock - lock/unlock a range of records in an open file

Procedures:

  • Reset - close all open disk files
  • Width - set the limit for line lengths when printing
  • ChDir, ChDrive - change the current working directory and disk drive
  • MkDir, RmDir - create/remove a directory on disk
  • Name - rename a file or directory on disk
  • SetAttr - set attributes of a file on disk
  • FileCopy - copy a file on disk
  • Kill - delete a file from disk
  • SavePicture - write a Picture or Image to a disk file

State Management

Procedures:

Events and Interaction

Statements:

  • RaiseEvent - raise an event that may be handled by event handlers

See also

  • Event - declare an event

Procedures:

  • AppActivate - change the focus to, or activate, a named window
  • Beep - sound a system beep
  • SendKeys - send keystrokes to the active window

Mathematics

Procedures:

  • Atn, Cos, Sin, Tan - trigonometric functions
  • Sqr - take a square root
  • Exp - calculate an exponential with base $e$
  • Log - calculate the natural (base $e$) logarithm of a number
  • Sgn - return the sign of a number
  • Abs - returns the absolute value of a number
  • Round - round the number to a given number of decimal places
  • Rnd - generate a random number in the range [0.0, 1.0)
  • Randomize - seed the random number generator

String Handling

Statements that modify strings:

  • Mid =, MidB = - assign to or replace characters or wide/narrow string sections

Procedures that check properties of strings:

Procedures that create strings:

Procedures that return modified strings:

See also:

Date and Time

Procedures:

  • Date, Time - set the current date and time
  • FormatDateTime - formats an expression as a date/time string
  • MonthName - returns the name of the specified month
  • WeekdayName - returns the name of the specified day of the week

Financial

Procedures:

  • DDB - depreciation of an asset via the Double-Declining Balance method
  • FV - future value of an investment with constant deposits and interest
  • Pmt - payment for a loan with constant payments and interest
  • IPmt - interest payment for a loan with constant payments and interest
  • PPmt - principal payment for a loan with constant payments and interest
  • SYD - sum-of-years’ digits depreciation of an asset
  • SLN - straight-line depreciation of an asset in one period
  • PV - present value of investment
  • IRR - internal rate of return for a series of cash flows
  • MIRR - modified internal rate of return for a series of cash flow
  • Rate - interest rate per period of an annuity
  • NPV - net present value of an investment
  • NPer - number of periods for an investment with constant deposits and interest
  • FormatCurrency - format an expression as a currency string

Deprecated

Statements: