Post by lete on Feb 3, 2007 6:24:00 GMT
This is a part of the Chapter 1 of the book:
"Basic v7.1. Getting Started."
of the QuickBasic Extended v7.1 (PDS), that
describes features of the PDS v7.0 and v.7.1.
Chapter 1. New Features.
Changes for version 7.1 are indicated by the words "Version 7.1".
Microsoft Basic version 7.1 extends Basic's power under OS/2,
improves its compatibility with other languages, and provides
new language features:
(a) Basic's Indexed Sequential Access Method (Isam) is now fully
supported for OS/2.
(b) The Programmer's WorkBench (PWB) provides a sophisticated
development environment for mixed-language programming under Dos
or OS/2.
(c) The CodeView debugger version 3.0 contains many improvements
to simplify the tasks of debugging large Basic and
mixed-language programs under Dos or under OS/2.
(d) QuickHelp provides access to the Microsoft Advisor Help
system from the command line.
(e) The new Redim Preserve statement lets you change the size
of an array without erasing the data it contains.
(f) Basic now supports passing parameters by value within Basic
procedures and passing arrays containing fixed length strings as
parameters.
(g) Basic is fully compatible with Microsoft C version 6.0.
The rest of this chapter discusses the features new to
Microsoft Basic versions 7.0 and 7.1 in greater detail.
Integrated Isam.
The 'Indexed Sequential Access Method' package provides a fast
and simple method for accessing specific records in large and
complex data files. Microsoft Basic integrates all Isam
statements and functions with the Basic language. Basic Isam
includes statements for transaction processing and for data
retrieval and manipulation. Version 7.1.~ In this version, the
Isam statements and functions are supported for OS/2 as well as
Dos.
Isam.
Microsoft Basic also includes several utilities for use with
Isam files created with Basic:
Isamcvt.exe (Dos only) converts Btrieve and dBase files for use
with Isam.
Isamrepr.exe repairs corrupted Isam databases.
Isampack.exe compacts Isam files to save disk space.
Isamio.exe converts Ascii files to Isam format and vice versa.
Dos File Management.
The Dir$ and Curdir$ functions and the Chdrive statement make it
easier to manage Dos files from Basic programs. Dir$ is similar
to the Dos Dir command, except that the filenames are returned
one at a time. Curdir$ returns the current directory
specification, and Chdrive changes the current drive.
Currency Data Type.
The currency data type maintains to-the-penny precision while
providing the speed of integer math for programming accounting
tasks. Its internal representation as an integer gives this type
a significant advantage in speed over the floating-point data
type for operations such as addition and subtraction.
Procedure-Level Error Handling.
Microsoft Basic contains local error trapping and handling for
procedures, making error handling much more efficient. In
previous versions of Basic, error-handling routines existed at
the module level. When a handler was turned on, it was active
for all procedures within the module. With Microsoft Basic, you
can create both module-level and procedure-level error handlers.
The same error can invoke different error-handling routines,
depending on which procedure is running. For example, you may
want to invoke different error-handling routines for Err code
54, Bad File Mode, because the error has different meanings for
different file operations.
Static Arrays In Records.
In previous versions of Basic, you could create user-defined
data structures that contained numeric and fixed-string data
types by using the Type...End Type statements. Now you can
use static arrays in addition to numeric and string data types,
which gives you more flexibility in building data structures.
Preserve Data When Redimensioning An Array.
Version 7.1. By adding the Preserve option to the Redim
statement, you can preserve the data that exists in an array
when changing its outer boundary. This simplifies the dynamic
control of the amount of memory consumed by an array.
Improved Parameter Passing.
Version 7.1. With previous versions of Basic, you could emulate
passing parameters by value by surrounding the parameter with
parentheses. Now you can use the Byval keyword in Declare, Sub,
and Function statements for Basic procedures. For details on
passing parameters by value, see the online Help for the
Declare, Sub, and Function statements. Basic now also supports
passing arrays containing fixed-length strings as parameters.
Improved Com Support With Erdev$ And Erdev.
With previous versions of Basic, if you had a device timeout
error, there was no way to find out which device timed out, or
which control line caused the timeout. With Microsoft Basic,
information about the timeout is available through the Erdev$
and Erdev functions. Erdev$ indicates whether a timeout is
occurring on the communications port. Erdev indicates the type
of timeout error that occurred (that is, Cts, Dsr, or Dcd
control-line errors).
Date/Time, Financial, And Format Add-On Libraries.
With these new libraries, you can use Basic to perform
spreadsheet-style calculations and formatting. For example, you
can compute the number of days between two dates by converting
the dates from month-day-year format to number format, and then
subtracting. You can use financial functions to calculate
double-declining balance depreciation, future value, net present
value, internal rate of return, and other common financial
calculations.
Matrix Math Toolbox.
The new Matrix Math toolbox contains sample Basic code for
several common matrix math operations, including addition,
subtraction, multiplication and division, matrix inversion,
determinant calculation, and solution of simultaneous equations
using Gaussian elimination.
Presentation Graphics Toolbox.
You can use the Presentation Graphics toolbox to display charts
and graphs from your programs. The Presentation Graphics toolbox
includes procedures for pie charts, bar and column charts, line
graphs, and scatter diagrams. The toolbox also includes a set
of special graphics fonts.
User Interface Toolbox.
With the new user interface code samples, you can design your
own user interface using Basic procedures. The code samples in
this toolbox give you complete control of character-based window
interfaces. For example, you could write a Basic program with
multiple windows, menu bars, dialog boxes, and mouse
interaction.
C Version 6.0 Compatibility.
Version 7.1. Basic incorporates the C version 6.0 startup code.
This makes Basic fully compatible with the latest version of C.
However, this can cause problems for mixed-language programmers
who have earlier versions of C, Fortran, or Pascal. Compatible
run-times for these languages are available free from Microsoft.
Capacity And Performance Enhancements.
Microsoft Basic eliminates many of the capacity and performance
barriers that formerly limited the size and sophistication of
Basic applications.
Far String Support.
In previous versions of Basic, all variable-length string data
was stored in near memory. This relatively small portion of
memory (64 Kbs. maximum) also stores the rest of the simple
variables--integers, floating-point numbers and fixed strings,
all constants, the stack, and some run-time overhead.
Even when the only variables you use are variable-length strings,
your maximum data storage is limited. Microsoft Basic supports
"far strings", which enable you to store variable-length string
data outside of near memory in multiple segments of far memory.
This gives you a full 64 Kbs. of string storage in the module
level of the main module, plus several additional 64 Kbs. blocks
of storage, depending on how you write your program. Removing
variable-length strings from near memory creates significantly
more room for other simple variables.
Overlay Support.
With overlays, you can write and run programs up to almost 16
megabytes in size when compiling and linking from the command
line. In an overlaid version of a program, specified parts of
the program are only loaded if and when they are needed.
Specifying overlays can be useful if you have compiled a program
that is too large to load in memory.
Improved Granularity.
The extent to which Basic run-time routines are divided into
individually accessible pieces is called "granularity". With
Microsoft Basic's improved granularity, you can link with the
minimum amount of library code needed to produce stand-alone
programs. This gives you smaller compiled programs, saving disk
space and memory.
Optimized Code Generation.
Optimized code generation automatically makes compiled Basic
programs smaller and faster. Also, using a new compiler switch,
you can tell the compiler to generate code for the 80286 (and
later) microprocessor family, taking advantage of that family's
machine instructions.
Improved Alternate Math Package.
For target systems without an 80x87 math coprocessor, the
alternate math package gives programs greatly improved speed.
For example, if your application involves spreadsheet-style math
without recursive calculations, using the alternate math package
may give you a noticeable performance increase.
Improved Ieee Math Coprocessor Emulation.
For target systems with or without a math coprocessor, an
improved coprocessor emulator gives you faster high precision
calculations.
Improved Code Generation.
Version 7.1. Relative jumps and short jumps to near targets are
optimized, resulting in smaller, faster programs. This
improvement affects all control statements.
Environment And Usability Enhancements.
Microsoft Basic offers two sophisticated development
environments: Microsoft QuickBasic Extended (QBX) and Microsoft
Programmer's WorkBench (PWB). Both provide the following
advanced features:
(a) Integrated debugging capabilities within the environment and
compatibility with CodeView version 3.0 for debugging and
optimizing executable programs at a variety of levels.
(b) Support for expanded memory specification (Ems 4.0) to create
large executable programs.
(c) Undo/redo capabilities.
(d) Customizable menus and key assignments.
(e) Control of build options and target environment from the
development environment.
(f) A comprehensive online Help system designed for professional
programmers.
(g) In addition to QBX and the PWB, the Basic now includes the
QuickHelp environment for viewing Microsoft Advisor online Help
files.
The Quickbasic Extended Environment.
Microsoft QuickBasic Extended (QBX) is an advanced development
environment for programmers who write most or all of their code
in Basic. It provides line-by-line syntax checking and on-demand
program execution without recompiling. QBX also provides the
following key features:
(a) QBX automatically uses expanded memory, if present, for any
parts of your program source code that are less than 16 Kbs. in
size. The View Subs command now enables you to determine whether
a program unit (module-level code or procedure) will fit into
expanded memory.
(b) Historical Undo/redo commands. You can use Undo to step back
through your last 20 edits.
(c) A customizable Utility menu. You can use the Utility menu to
run Dos command-line programs or a custom editor, or for
command-line compiling and overlay linking. You can even assign
each menu item a shortcut key.
(d) Customizable key assignments. If you prefer to use a set of
editing commands other than the QBX defaults, you can change
your key file to one of those provided, or you can create your
own custom assignments.
(e) nPrint to multiple printers or to a file.
(f) Debug watch window capacity doubled (from 8 to 16
expressions).
(g) Complete control of compiler switches for compiling from the
environment.
THE PROGRAMMER'S WORKBENCH ENVIRONMENT.
Version 7.1. Microsoft Programmer's WorkBench (PWB) is an
advanced development environment for programmers who often work
in languages other than Basic or who want to create, build, and
debug their programs under OS/2. The PWB also offers the
following key features:
(a) The PWB runs in real or protected modes, so you can write
Basic programs under Dos or OS/2.
(b) You can write programs in any Microsoft professional level
language and mix languages, such as Basic and C, within the
environment.
(c) The Source Browser allows you to search selected files, list
references and definitions, build a call tree and outline, and
view a list of relationships among program symbols.
(d) You can step through compiler errors and the PWB will
indicate where each error occurred in the source code.
(e) The PWB and CodeView are integrated, so you can switch from
one to the other without exiting the PWB.
(f) Comprehensive Help is available on all command-line utilities
and Microsoft languages installed on your system.
The Codeview Debugger.
Version 7.1. The CodeView debugger allows you to debug programs
under Dos or OS/2. This is especially useful when you are using
assembly language routines in a Basic program. CodeView version
3.0 offers the following new features:
(a) Comprehensive online Help on how to use CodeView. Help is
also available on any installed Microsoft language or utility
from within CodeView.
(b) Automatic use of extended and expanded memory, if available.
(c) Full integration with the PWB and compatibility with programs
created in QBX.
Quickhelp.
Version 7.1. Microsoft QuickHelp reads Microsoft Advisor online
Help files under Dos or OS/2. This provides you with an easy way
to get Help on the command-line utilities and development
environments without loading QBX, the PWB, or CodeView. If you
are using OS/2 or Microsoft Windows, you can run QuickHelp in
one window and do your programming in another. This can be more
convenient than using Help in the programming environment, which
obscures part of the program you are working on.
"Basic v7.1. Getting Started."
of the QuickBasic Extended v7.1 (PDS), that
describes features of the PDS v7.0 and v.7.1.
Chapter 1. New Features.
Changes for version 7.1 are indicated by the words "Version 7.1".
Microsoft Basic version 7.1 extends Basic's power under OS/2,
improves its compatibility with other languages, and provides
new language features:
(a) Basic's Indexed Sequential Access Method (Isam) is now fully
supported for OS/2.
(b) The Programmer's WorkBench (PWB) provides a sophisticated
development environment for mixed-language programming under Dos
or OS/2.
(c) The CodeView debugger version 3.0 contains many improvements
to simplify the tasks of debugging large Basic and
mixed-language programs under Dos or under OS/2.
(d) QuickHelp provides access to the Microsoft Advisor Help
system from the command line.
(e) The new Redim Preserve statement lets you change the size
of an array without erasing the data it contains.
(f) Basic now supports passing parameters by value within Basic
procedures and passing arrays containing fixed length strings as
parameters.
(g) Basic is fully compatible with Microsoft C version 6.0.
The rest of this chapter discusses the features new to
Microsoft Basic versions 7.0 and 7.1 in greater detail.
Integrated Isam.
The 'Indexed Sequential Access Method' package provides a fast
and simple method for accessing specific records in large and
complex data files. Microsoft Basic integrates all Isam
statements and functions with the Basic language. Basic Isam
includes statements for transaction processing and for data
retrieval and manipulation. Version 7.1.~ In this version, the
Isam statements and functions are supported for OS/2 as well as
Dos.
Isam.
Microsoft Basic also includes several utilities for use with
Isam files created with Basic:
Isamcvt.exe (Dos only) converts Btrieve and dBase files for use
with Isam.
Isamrepr.exe repairs corrupted Isam databases.
Isampack.exe compacts Isam files to save disk space.
Isamio.exe converts Ascii files to Isam format and vice versa.
Dos File Management.
The Dir$ and Curdir$ functions and the Chdrive statement make it
easier to manage Dos files from Basic programs. Dir$ is similar
to the Dos Dir command, except that the filenames are returned
one at a time. Curdir$ returns the current directory
specification, and Chdrive changes the current drive.
Currency Data Type.
The currency data type maintains to-the-penny precision while
providing the speed of integer math for programming accounting
tasks. Its internal representation as an integer gives this type
a significant advantage in speed over the floating-point data
type for operations such as addition and subtraction.
Procedure-Level Error Handling.
Microsoft Basic contains local error trapping and handling for
procedures, making error handling much more efficient. In
previous versions of Basic, error-handling routines existed at
the module level. When a handler was turned on, it was active
for all procedures within the module. With Microsoft Basic, you
can create both module-level and procedure-level error handlers.
The same error can invoke different error-handling routines,
depending on which procedure is running. For example, you may
want to invoke different error-handling routines for Err code
54, Bad File Mode, because the error has different meanings for
different file operations.
Static Arrays In Records.
In previous versions of Basic, you could create user-defined
data structures that contained numeric and fixed-string data
types by using the Type...End Type statements. Now you can
use static arrays in addition to numeric and string data types,
which gives you more flexibility in building data structures.
Preserve Data When Redimensioning An Array.
Version 7.1. By adding the Preserve option to the Redim
statement, you can preserve the data that exists in an array
when changing its outer boundary. This simplifies the dynamic
control of the amount of memory consumed by an array.
Improved Parameter Passing.
Version 7.1. With previous versions of Basic, you could emulate
passing parameters by value by surrounding the parameter with
parentheses. Now you can use the Byval keyword in Declare, Sub,
and Function statements for Basic procedures. For details on
passing parameters by value, see the online Help for the
Declare, Sub, and Function statements. Basic now also supports
passing arrays containing fixed-length strings as parameters.
Improved Com Support With Erdev$ And Erdev.
With previous versions of Basic, if you had a device timeout
error, there was no way to find out which device timed out, or
which control line caused the timeout. With Microsoft Basic,
information about the timeout is available through the Erdev$
and Erdev functions. Erdev$ indicates whether a timeout is
occurring on the communications port. Erdev indicates the type
of timeout error that occurred (that is, Cts, Dsr, or Dcd
control-line errors).
Date/Time, Financial, And Format Add-On Libraries.
With these new libraries, you can use Basic to perform
spreadsheet-style calculations and formatting. For example, you
can compute the number of days between two dates by converting
the dates from month-day-year format to number format, and then
subtracting. You can use financial functions to calculate
double-declining balance depreciation, future value, net present
value, internal rate of return, and other common financial
calculations.
Matrix Math Toolbox.
The new Matrix Math toolbox contains sample Basic code for
several common matrix math operations, including addition,
subtraction, multiplication and division, matrix inversion,
determinant calculation, and solution of simultaneous equations
using Gaussian elimination.
Presentation Graphics Toolbox.
You can use the Presentation Graphics toolbox to display charts
and graphs from your programs. The Presentation Graphics toolbox
includes procedures for pie charts, bar and column charts, line
graphs, and scatter diagrams. The toolbox also includes a set
of special graphics fonts.
User Interface Toolbox.
With the new user interface code samples, you can design your
own user interface using Basic procedures. The code samples in
this toolbox give you complete control of character-based window
interfaces. For example, you could write a Basic program with
multiple windows, menu bars, dialog boxes, and mouse
interaction.
C Version 6.0 Compatibility.
Version 7.1. Basic incorporates the C version 6.0 startup code.
This makes Basic fully compatible with the latest version of C.
However, this can cause problems for mixed-language programmers
who have earlier versions of C, Fortran, or Pascal. Compatible
run-times for these languages are available free from Microsoft.
Capacity And Performance Enhancements.
Microsoft Basic eliminates many of the capacity and performance
barriers that formerly limited the size and sophistication of
Basic applications.
Far String Support.
In previous versions of Basic, all variable-length string data
was stored in near memory. This relatively small portion of
memory (64 Kbs. maximum) also stores the rest of the simple
variables--integers, floating-point numbers and fixed strings,
all constants, the stack, and some run-time overhead.
Even when the only variables you use are variable-length strings,
your maximum data storage is limited. Microsoft Basic supports
"far strings", which enable you to store variable-length string
data outside of near memory in multiple segments of far memory.
This gives you a full 64 Kbs. of string storage in the module
level of the main module, plus several additional 64 Kbs. blocks
of storage, depending on how you write your program. Removing
variable-length strings from near memory creates significantly
more room for other simple variables.
Overlay Support.
With overlays, you can write and run programs up to almost 16
megabytes in size when compiling and linking from the command
line. In an overlaid version of a program, specified parts of
the program are only loaded if and when they are needed.
Specifying overlays can be useful if you have compiled a program
that is too large to load in memory.
Improved Granularity.
The extent to which Basic run-time routines are divided into
individually accessible pieces is called "granularity". With
Microsoft Basic's improved granularity, you can link with the
minimum amount of library code needed to produce stand-alone
programs. This gives you smaller compiled programs, saving disk
space and memory.
Optimized Code Generation.
Optimized code generation automatically makes compiled Basic
programs smaller and faster. Also, using a new compiler switch,
you can tell the compiler to generate code for the 80286 (and
later) microprocessor family, taking advantage of that family's
machine instructions.
Improved Alternate Math Package.
For target systems without an 80x87 math coprocessor, the
alternate math package gives programs greatly improved speed.
For example, if your application involves spreadsheet-style math
without recursive calculations, using the alternate math package
may give you a noticeable performance increase.
Improved Ieee Math Coprocessor Emulation.
For target systems with or without a math coprocessor, an
improved coprocessor emulator gives you faster high precision
calculations.
Improved Code Generation.
Version 7.1. Relative jumps and short jumps to near targets are
optimized, resulting in smaller, faster programs. This
improvement affects all control statements.
Environment And Usability Enhancements.
Microsoft Basic offers two sophisticated development
environments: Microsoft QuickBasic Extended (QBX) and Microsoft
Programmer's WorkBench (PWB). Both provide the following
advanced features:
(a) Integrated debugging capabilities within the environment and
compatibility with CodeView version 3.0 for debugging and
optimizing executable programs at a variety of levels.
(b) Support for expanded memory specification (Ems 4.0) to create
large executable programs.
(c) Undo/redo capabilities.
(d) Customizable menus and key assignments.
(e) Control of build options and target environment from the
development environment.
(f) A comprehensive online Help system designed for professional
programmers.
(g) In addition to QBX and the PWB, the Basic now includes the
QuickHelp environment for viewing Microsoft Advisor online Help
files.
The Quickbasic Extended Environment.
Microsoft QuickBasic Extended (QBX) is an advanced development
environment for programmers who write most or all of their code
in Basic. It provides line-by-line syntax checking and on-demand
program execution without recompiling. QBX also provides the
following key features:
(a) QBX automatically uses expanded memory, if present, for any
parts of your program source code that are less than 16 Kbs. in
size. The View Subs command now enables you to determine whether
a program unit (module-level code or procedure) will fit into
expanded memory.
(b) Historical Undo/redo commands. You can use Undo to step back
through your last 20 edits.
(c) A customizable Utility menu. You can use the Utility menu to
run Dos command-line programs or a custom editor, or for
command-line compiling and overlay linking. You can even assign
each menu item a shortcut key.
(d) Customizable key assignments. If you prefer to use a set of
editing commands other than the QBX defaults, you can change
your key file to one of those provided, or you can create your
own custom assignments.
(e) nPrint to multiple printers or to a file.
(f) Debug watch window capacity doubled (from 8 to 16
expressions).
(g) Complete control of compiler switches for compiling from the
environment.
THE PROGRAMMER'S WORKBENCH ENVIRONMENT.
Version 7.1. Microsoft Programmer's WorkBench (PWB) is an
advanced development environment for programmers who often work
in languages other than Basic or who want to create, build, and
debug their programs under OS/2. The PWB also offers the
following key features:
(a) The PWB runs in real or protected modes, so you can write
Basic programs under Dos or OS/2.
(b) You can write programs in any Microsoft professional level
language and mix languages, such as Basic and C, within the
environment.
(c) The Source Browser allows you to search selected files, list
references and definitions, build a call tree and outline, and
view a list of relationships among program symbols.
(d) You can step through compiler errors and the PWB will
indicate where each error occurred in the source code.
(e) The PWB and CodeView are integrated, so you can switch from
one to the other without exiting the PWB.
(f) Comprehensive Help is available on all command-line utilities
and Microsoft languages installed on your system.
The Codeview Debugger.
Version 7.1. The CodeView debugger allows you to debug programs
under Dos or OS/2. This is especially useful when you are using
assembly language routines in a Basic program. CodeView version
3.0 offers the following new features:
(a) Comprehensive online Help on how to use CodeView. Help is
also available on any installed Microsoft language or utility
from within CodeView.
(b) Automatic use of extended and expanded memory, if available.
(c) Full integration with the PWB and compatibility with programs
created in QBX.
Quickhelp.
Version 7.1. Microsoft QuickHelp reads Microsoft Advisor online
Help files under Dos or OS/2. This provides you with an easy way
to get Help on the command-line utilities and development
environments without loading QBX, the PWB, or CodeView. If you
are using OS/2 or Microsoft Windows, you can run QuickHelp in
one window and do your programming in another. This can be more
convenient than using Help in the programming environment, which
obscures part of the program you are working on.