basic_reserved_words_-_basic_programming_language_keywords

BASIC Reserved words - BASIC Programming Language keywords

Return to BASIC Programming, Language Reserved Keywords, Reserved, Reserved words, Reserved identifier, Keywords

Major programming topics, Programming topics, Programming languages, Software engineering topics, Software architecture, Software architecture topics, Awesome lists

Snippet from Wikipedia: Reserved word

In a programming language, a reserved word (sometimes known as a reserved identifier) is a word that cannot be used by a programmer as an identifier, such as the name of a variable, function, or label – it is "reserved from use". In brief, an identifier starts with a letter, which is followed by any sequence of letters and digits (in some languages underline '_' is treated as a letter!).

In an imperative programming language and in many object-oriented programming languages, apart from assignments and subroutine calls, keywords are often used to identify a particular statement, e.g. if, while, do, for, etc. Many languages treat keywords as reserved words, including Ada, C, C++, COBOL, Java, and Pascal. The number of reserved words varies widely from one language to another: C has about 30 while COBOL has about 400.

Note that a few languages do not have any reserved words. Fortran and PL/I identify keywords by context, while Algol 60 and Algol 68 generally use stropping to distinguish keywords from programmer-defined identifiers, e.g. .if or 'if or 'if'is a keyword distinct from identifier if.

Most programming languages have a standard library (or libraries), e.g. mathematical functions sin, cos, etc. The names provided by a library are not reserved, and can be redefined by a programmer if the library functionality is not required.

Typical BASIC keywords

BASIC Data manipulation

  • BASIC LET - assigns a value (which may be the result of an expression) to a variable. In most dialects of BASIC, LET is optional, and a line with no other identifiable keyword will assume the keyword to be LET.
  • BASIC DATA - holds a list of values which are assigned sequentially using the READ command.
  • BASIC READ - reads a value from a DATA statement and assigns it to a variable. An internal pointer keeps track of the last DATA element that was read and moves it one position forward with each READ. Most dialects allow multiple variables as parameters, reading several values in a single operation.
  • BASIC RESTORE - resets the internal pointer to the first DATA statement, allowing the program to begin READing from the first value. Many dialects allow an optional line number or ordinal value to allow the pointer to be reset to a selected location.

BASIC Program flow control

  • BASIC IF ... THEN ... {ELSE} - used to perform comparisons or make decisions. Early dialects only allowed a line number after the THEN, but later versions allowed any valid statement to follow. ELSE was not widely supported, especially in earlier versions.
  • BASIC WHILE ... WEND and REPEAT ... UNTIL - repeat a section of code while the specified condition is true. The condition may be evaluated before each iteration of the loop, or after. Both of these commands are found mostly in later dialects.
  • BASIC DO ... LOOP {WHILE} or {UNTIL} - repeat a section of code indefinitely or while/until the specified condition is true. The condition may be evaluated before each iteration of the loop, or after. Similar to WHILE, these keywords are mostly found in later dialects.
  • BASIC GOTO - jumps to a numbered or labelled line in the program. Most dialects also allowed the form GO TO.
  • BASIC GOSUB ... RETURN - jumps to a numbered or labelled line, executes the code it finds there until it reaches a RETURN command, on which it jumps back to the statement following the GOSUB, either after a colon, or on the next line. This is used to implement subroutines.
  • BASIC ON ... GOTO/GOSUB - chooses where to jump based on the specified conditions. See Switch statement for other forms.
  • BASIC DEF FN - a pair of keywords introduced in the early 1960s to define functions. The original BASIC functions were modelled on FORTRAN single-line functions. BASIC functions were one expression with variable arguments, rather than subroutines, with a syntax on the model of DEF FND(x) = x*x at the beginning of a program. Function names were originally restricted to FN, plus one letter, i.e., FNA, FNB …

BASIC Input and output

  • BASIC LIST - displays the full source code of the current program.
  • BASIC PRINT - displays a message on the screen or other output device.
  • BASIC INPUT - asks the user to enter the value of a variable. The statement may include a prompt message.
  • BASIC TAB - used with PRINT to set the position where the next character will be shown on the screen or printed on paper. AT is an alternative form.
  • BASIC SPC - prints out a number of space characters. Similar in concept to TAB but moves by a number of additional spaces from the current column rather than moving to a specified column.

BASIC Mathematical functions

BASIC Miscellaneous Keywords

  • BASIC REM - holds a programmer's comment or REMark; often used to give a title to the program and to help identify the purpose of a given section of code.
  • BASIC USR - transfers program control to a machine language subroutine, usually entered as an alphanumeric string or in a list of DATA statements.

alternative form of BASIC USR found in some BASIC dialects. Does not require an artificial parameter to complete the function-like syntax of USR, and has a clearly defined method of calling different routines in memory.

  • BASIC TRON / * BASIC TROFF - turns on display of each line number as it is run (“TRace ON”). This was useful for debugging or correcting of problems in a program. TROFF turns it back off again.

BASIC Programming Language: BASIC Programming Fundamentals, BASIC Programming Language Inventor - BASIC Language Designer: John G. Kemeny and Thomas E. Kurtz of Dartmouth College on May 1, 1964; Applesoft BASIC, Microsoft BASIC, QuickBASIC, QBasic, FreeBASIC, Endless Loop - The History of the BASIC Programming Language (Beginner's All-purpose Symbolic Instruction Code) by Mark Jones Lorenzo, Legacy Language, BASIC keywords, BASIC Bibliography, Awesome BASIC; (navbar_basic)

Reserved Keywords: (Also called: Language Keywords, Reserved Keyword, Reserved Word, Keywords, Reserved Identifier, Reserved Identifiers) Ada Keywords, ALGOL 68 Keywords, Angular Keywords, Android Keywords, Apple iOS Keywords, ARM Assembly Keywords, Assembly Keywords, AWK Keywords, Bash Keywords, BASIC Keywords, C Keywords (https://en.cppreference.com/w/c/keyword), C Sharp Keywords | Keywords, dot NET Keywords | NET Keywords, C plus plus Keywords | C++ Keywords (https://en.cppreference.com/w/cpp/keyword), Clojure Keywords, COBOL Keywords, Dart Keywords, Delphi Keywords, Django Keywords, Elixir Keywords, Erlang Keywords, F Sharp Keywords, Fortran Keywords, Flask Keywords, Golang Keywords, Groovy Keywords, Haskell Keywords, Jakarta EE Keywords, Java Keywords, JavaScript Keywords, JCL Keywords, Julia Keywords, Kotlin Keywords, Lisp Keywords (Common Lisp Keywords), Lua Keywords, MATHLAB Keywords, Objective-C Keywords, OCaml‎ Keywords, Pascal Keywords, Perl Keywords, PHP Keywords, PL/I Keywords, PowerShell Keywords, Python Keywords, Quarkus Keywords, R Language Keywords, React.js Keywords, Rexx Keywords, RPG Keywords, Ruby Keywords, Rust Keywords, Scala Keywords, Spring Keywords, SQL Keywords, Swift Keywords, Transact-SQL Keywords, TypeScript Keywords, Visual Basic Keywords, Vue.js Keywords, X86 Assembly Keywords, X86-64 Assembly Keywords. (navbar_reserved_keywords - see also navbar_cpp_keywords)


Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


basic_reserved_words_-_basic_programming_language_keywords.txt · Last modified: 2025/02/01 07:15 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki