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 computer language, a reserved word (also known as a reserved identifier) is a word that cannot be used as an identifier, such as the name of a variable, function, or label – it is "reserved from use". This is a syntactic definition, and a reserved word may have no user-defined meaning.

A closely related and often conflated notion is a keyword, which is a word with special meaning in a particular context. This is a semantic definition. By contrast, names in a standard library but not built into a language are not considered reserved words or keywords. The terms "reserved word" and "keyword" are often used interchangeably – one may say that a reserved word is "reserved for use as a keyword" – and formal use varies from language to language. For this article, we distinguish as above.

In general reserved words and keywords need not coincide, but in most modern languages keywords are a subset of reserved words, as this makes parsing easier, since keywords cannot be confused with identifiers. In some languages, like C or Python, reserved words and keywords coincide, while in other languages, like Java, all keywords are reserved words, but some reserved words are not keywords, being reserved for future use. In yet other languages, such as the older languages ALGOL, FORTRAN, and PL/I, there are keywords but no reserved words, with keywords being distinguished from identifiers by other means.

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# Keywords, .NET 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. © 2005 - 2024 Losang Jinpa 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: 2023/06/29 17:19 by 127.0.0.1