Hardware Reference
In-Depth Information
Table 6.1 QuickBASIC variable types
Number of
bytes for
Class
Type
storage
Range of values
Identifier
Examples
Notes
Numeric
Integer
2
32 768 to
%
min%
Stored in 16-bit 2's
+ 32 767
complement format
Numeric
Long integer
4
2 147 483 648 to
&
alt&
Stored in 16-bit 2's
+ 2 147 483 647
complement format
Numeric
Single-precision
4
3.4E + 38 to
!
val!
Stored in IEEE format
floating point
+ 3.4E + 38 (approx.)
(accurate to seven
decimal places)
Numeric
Double-precision
8
1.797E + 308 to
#
max#
Stored in IEEE format
floating point
+ 1.797E + 308
(accurate to 15
(approx.)
or 16 digits)
String
Character
Fixed
n/a
$
input$
Length must be
declared (max. 32 767)
String
Character
Variable
n/a
$
file$
Length can be
variable (max. 32 767)
consistency with the choice of variable names and also to ensure that, as far as
possible, they are descriptive. Examples of acceptable variable names are:
chan% channel number (integer)
col% column number (integer)
date$ date (string - typical format mmddyyyy )
day$ day of the week (string)
error$ error message (string)
file$ filename (string)
inp% input port address (integer)
lim% limit value (integer)
outp% output port address (integer)
prompt$ user prompt (string)
r$ general user response (string - usually
a single character)
time$ time (string - typical format hhmmss)
vel& velocity (single precision floating point)
ver$ version number (string)
x% x-axis displacement (integer)
y% y-axis displacement (integer)
BASIC command
summary
The following is a summary of BASIC commands that are found in most modern
versions of BASIC. Note that Windows specific commands have been excluded
from this list and not all of the listed commands may be available in any par-
ticular version of the language. In all cases, readers are advised to familiarize
themselves with the command set and command syntax applicable to the version
of BASIC that they will actually be using!
Search WWH ::




Custom Search