HOME

TheInfoList



OR:

TI-BASIC 83,TI-BASIC Z80 or simply TI-BASIC, is the built-in programming language for the
Texas Instruments Texas Instruments Incorporated (TI) is an American multinational semiconductor company headquartered in Dallas, Texas. It is one of the top 10 semiconductor companies worldwide based on sales volume. The company's focus is on developing analog ...
programmable calculators Programmable calculators are calculators that can automatically carry out a sequence of operations under the control of a stored program. Most are Turing complete, and, as such, are theoretically general-purpose computers. However, their user i ...
in the
TI-83 series The TI-83 series is a series of graphing calculators manufactured by Texas Instruments. The original TI-83 is itself an upgraded version of the TI-82. Released in 1996, it was one of the most popular graphing calculators for students. In addit ...
. Calculators that implement TI-BASIC have a built in editor for writing programs. While the considerably faster Z80
assembly language In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
is supported for the calculators, TI-BASIC's in-calculator editor and more user friendly syntax make it easier to use. TI-BASIC is interpreted.


Syntax

The syntax for TI-BASIC 83 is significantly different compared to most dialects of
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
. For example, the language does not permit indentation with
whitespace characters A whitespace character is a character (computing), character data element that represents White space (visual arts), white space when text string, text is Rendering (computer graphics), rendered for display by a computer. For example, a ''Space ...
. It also depends on the TI calculator character set because it is
tokenized Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
. Aside from these differences, TI-BASIC retains most
control flow In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an '' ...
statements: conditionals, various loops, GOTOs and
Labels A label (as distinct from signage) is a piece of paper, plastic film, cloth, metal, or other material affixed to a container or product. Labels are most often affixed to packaging and containers using an adhesive, or sewing when affixed to ...
. Conditionals and loops use End to denote the end of their bodies. Each command can be placed on a new line, or separated by a colon for brevity. As such, the following snippets are identical in function.
:Disp 42
:Disp "FOOBAR
and
:Disp 42:Disp "FOOBAR
In the above example the closing double quotes can be omitted because the colon causes all open markers to be closed. Unlike many
high-level programming languages A high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language ''elements'', be easier to use, or may automate ...
, TI-BASIC has only one assignment operator: . The rightward arrow (Known as "STO" on most calculators) assigns the value on the left to the variable on the right.


Conditionals

TI-BASIC includes simple constructs using the If statement. When the If token does not have a Then token on the following line it will only execute the next single command.
:If condition
:command
Where condition is any boolean statement. One benefit of this format is brevity as it does not include Then and End. An If statement may have more than one command in its body if, instead of a command, a Then token is placed.
:If condition
:Then
:command
:command
:End
When using Then, the body must be closed by an End token. One more construct utilizes Else. This allows one of two bodies to be executed.
:If condition
:Then
:body one
:Else
:body two
:End
In this case the calculator evaluates condition, if it evaluates to true body one is executed, however, if condition evaluates to false, body two is executed. Unlike many other programming languages, TI-BASIC has no else if construct, or any
switch statement In computer programming languages, a switch statement is a type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via search and map. Switch statements function ...
.


Menu( statement

It does, however, have a Menu( statement which allows a user to select one of a number of options. Similar to a switch menus do have fallthrough. The general syntax is Menu(, a quoted title string, and followed by quoted option name and label name. An example:
:Menu("TITLE","FIRST",1,"SECOND",2,"THIRD",3)
:Lbl 1
:body one
:Lbl 2
:body two
:Lbl 3
:body three
The image is how the calculator renders the example above. In terms of functionality, the Menu('s flow is similar to some switch statement and cases, with a key difference that the user supplies the switch's usual expression. Like many switches and cases, the Lbl allows fall-through. For example, in the code above, if a user selects "FIRST", all three bodies are executed. However, selecting "SECOND" means only the second and third bodies are executed.


Loops

TI-BASIC includes three types of loops: For(, While, and Repeat.


For(

For( is similar to many other languages. It will repeat commands either a set number of times, or a variable number.
:For(variable,start,end
increment Increment or incremental may refer to: *Incrementalism, a theory (also used in politics as a synonym for gradualism) * Increment and decrement operators, the operators ++ and -- in computer programming * Incremental computing * Incremental backup ...
:body :End


While and Repeat

While takes a single argument, a condition which must be fulfilled, without parentheses. Repeat functions the same way except that it loops when the given condition is false.
:While condition
:body
:End


DS<( and IS>(

DS<( and IS>( are specialized conditionals that are similar in overall function to If statements. However, they have the unique property of changing the value of the given variable.
:DS<(variable,value)
:Command


Data types and variables

TI-BASIC is strongly and mostly statically typed. Most variables, besides lists and programs, have predefined names and allowed types. Each variable can usually only hold one data type, the exceptions are the numeric and all list variables which can hold either real or complex values.


Numeric

There are 27 numeric variables, A through Z, and θ. These can hold two types of values, real and complex. All numbers are stored in the
RAM Ram, ram, or RAM most commonly refers to: * A male sheep * Random-access memory, computer memory * Ram Trucks, US, since 2009 ** List of vehicles named Dodge Ram, trucks and vans ** Ram Pickup, produced by Ram Trucks Ram, ram, or RAM may also ref ...
as
floating-point numbers In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a signed sequence of a fixed number of digits in some base) multiplied by an integer power of that base. Numbers of this form ...
with 14-digit mantissa, or
significand The significand (also coefficient, sometimes argument, or more ambiguously mantissa, fraction, or characteristic) is the first (left) part of a number in scientific notation or related concepts in floating-point representation, consisting of its s ...
, and an exponent range of -128 to 127.
Complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the for ...
s are stored as two consecutive reals.


List

Lists are also supported through the use of six built-in lists, and user created lists with up to five characters as the name. They are capable of holding up to 999 elements. A list may hold entirely real numbers or entirely imaginary numbers. Some functions in the calculator are able to operate over entire lists, via
Array programming In computer science, array programming refers to solutions that allow the application of operations to an entire set of values at once. Such solutions are commonly used in computational science, scientific and engineering settings. Modern program ...
.


Matrix

Matrices are supported through the use of ten built-in matrices. Matrices do not support user created names or complex numbers.


Strings

There are ten built-in strings for storing variable text, named Str1 through Str0.


Other data types

The TI-83 family supports several more data types other than numeric, list, and matrix types: token based data, screen image data, and graph database data. These data types cannot be directly manipulated by TI-BASIC.


References


External links


Texas Instruments' official websiteTI-Basic Developer
unofficial documentation {{BASIC Calculators Programming languages BASIC programming language family