basic.statements Definition/BASIC Program

basic.statements

Command basic.statements Definition/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description differences between statements and functions in Pick/BASIC, a working definition of variable, constant, labels, blanks, and program formatting.

If the syntax requires that the instruction be followed by a set of parentheses (optionally containing an argument or arguments), then it is a function. For example, the following are functions: "abs(num.expression)", "rnd(num.expression)" and "iconv(string.expression, conv.expression)".

Any instruction that does not have to be followed by a set of parentheses is most often a statement. For example: "print x", "input y", "execute sentence".

There is at least one peculiar exception to the above rule. One variant of the "locate" statement is considered a statement, even though its syntax looks like it should be a function.

Another feature of statements is that they tend to "stand alone". For instance: "execute sentence" or "print array<10,1>".

Functions, by contrast, do not stand alone. They are either used as part of an expression within a statement: "raise = rnd(20)", or output immediately: "crt int(amount)", "print abs(balance)".

A Pick/BASIC program is composed of statements made up of Pick/BASIC commands, variables, constants, expressions, and functions.

Pick/BASIC statements may contain arithmetic, relational, and logical expressions. These expressions are formed by combining specific operators with variables, constants, or Pick/BASIC intrinsic functions.

The value of a variable may change dynamically throughout the execution of a program. A constant, as its name implies, has the same value throughout the execution of a program.

An intrinsic function performs a pre-defined operation on the supplied parameter(s).

Normally, within a Pick/BASIC program, each physical line contains only one statement. This is done for ease of reading and tracking of logic.

More than one statement may be placed on a program line by separating each statement with a ";" (semicolon). Statements which end with "then" or "else" on a line create a block or multi-line structure. See the "if" statement for details on "then...else" statements.

Labels may be placed at the beginning of any Pick/BASIC statement. A statement label may be numeric or alphanumeric. See "statement labels".

Blank spaces appearing in the program line which are not part of a literal are ignored. Blank spaces and blank lines may be used freely within the program for purposes of appearance. (AP only -- R83 does not support blank source lines).
Syntax
Options
Example
Purpose
Related basic.string.expression
basic.num.expression
basic.cos
basic.assigned
basic.case
basic.clear
basic.col1
basic.col2
basic.convert
basic.crt
basic.debug
basic.delete.statement
basic.dim
basic.echo
basic.enter
basic.execute
basic.include
basic.index
basic.inputtrap.gosub
basic.inputtrap.goto
basic.let
basic.ln
basic.matread
basic.matwrite
basic.mod
basic.not
basic.occurs
basic.page
basic.precision
basic.procread
basic.pwr
basic.read
basic.readt
basic.readtl
basic.readtx
basic.readv
basic.rem.statement
basic.seq
basic.sin
basic.sleep
basic.sort
basic.soundex
basic.space
basic.str
basic.then
basic.write
basic.time()
basic.capturing
basic.reserved.words
basic.cfunc
basic.count
basic.close
basic.on.gosub
basic.on.goto
basic.abort
basic.replace
basic.release
basic.tclread
basic.stop
basic.casing
basic.print
basic.equate
basic.cfunction
basic.abs
basic.break
basic.int
basic.null
basic.tan
basic.readnext
basic.sqrt
basic.root
basic.num
basic.call
basic.alpha
basic.chain
basic.statement.labels
basic.open
basic.tcl
basic.subroutine
basic.conv.expression
basic.weof
basic.else
basic.oconv
basic.writet
basic.prompt
basic.iconv
basic.writev
basic.next
basic.xtd
basic.procwrite
basic.@.functions
basic.loop
basic.clearfile
basic.if
basic.inputerr
basic.timedate
basic.rem.function
basic.exit
basic.replace.statement
basic.lock
basic.ebcdic
basic.rewind
basic.functions
basic.trim
basic.nuclear.tokens
basic.inputnull
basic.select
basic.unlock
basic.print.on
basic.rnd
basic.char
basic.printer
basic.writevu
basic.field
basic.len
basic.for.next
basic.mat
basic.program
basic.system
basic.footing
basic.insert
basic.get
basic.fold
basic.locate
basic.common
basic.extract
basic.in
basic.heading
basic.error
basic.input@
basic.ascii
basic.access
basic.delete.function
basic.file
basic.$chain
basic.aux
basic.spoolq
basic.scan
basic.hush
basic.spooler
basic.convertfn
basic.@AM
basic.@FM
basic.@VM
basic.@SM
basic.fmt
basic.sentence
basic.swap
basic.filelock
basic.fileunlock
basic.ifr