telecomm, graphics from Herc to SVGA incl.
solver, virtual windows. By Tom Hanlin.
library, due to the number of routines involved.
Bascom/PDS, and Visual BASIC for DOS.
unmodified form. No files may be left out or added.
problems which BasWiz may cause you.
using the UNLIB utility that comes with LibWiz.
(use far strings if you use the QBX editor/environment).
that's tailored to your needs.
or to make the BCD range large enough to avoid these errors.
be 32 (20 to the left, 11 to the right, 1 for the sign).
them to a text string with BASIC's STR$ function, then to BCD.
e$ = BCDe$ ' the constant "e"
pi$ = BCDpi$ ' the constant "pi"
functions. BCDe$ is accurate to as many as 115 decimal places.
you to convert back and forth between radians and degrees.
Functions should not be nested.
Trig functions expect angles in radians.
when number crunching is what a computer does best?
e! = eS! ' the constant "e"
Pi! = PiS! ' the constant "pi"
e# = eD# ' the constant "e"
Pi# = PiD# ' the constant "pi"
simple reason that BASIC supplies an ATN function.
Constants are expressed to the maximum precision available.
of string space is a common and painful problem.
variable-length strings outside of BASIC's tiny string area.
system memory or expanded memory may be used.
identify that string for future reference.
initialize at the beginning and terminate at the end.
can't use BasWiz far strings.
A working example of far string use is provided in FDEMO.BAS.
Somewhat simplified code is given below as an overview.
using a new variable for the first time.
and cannot transfer information in large quantities at a time.
The BasWiz routines provide additional flexibility and power.
point you find convenient via a single function call.
- Optional input buffers speed up reading from files.
- Up to 32K of data may be read or written at one time.
place no arbitrary limitations on the programmer.
never have to worry about a file number already being in use.
We'll refer to the file number as a "file handle" from now on.
files, or possibly up to 50 if you are using DOS 3.3 or higher.
Before your program ends, you should terminate the file handler.
at the error handler first.
other file routines do not return a direct error code, however.
specific error codes even when everything is fine.
which read from a file.
the end of the file. This works like the EOF function in BASIC.
starting at array element zero.
text output on a file that was opened in binary mode, however.
reading and writing if you use a buffer (or text mode).
and FWriteLn is like PRINT without a semicolon.
LONG integer) can go up to however many bytes are in the file.
that the result will be an integer.
handle be available, before DOS 4.0.
which also makes use of the file routines.
files, so we can do it in both plain BASIC and with BasWiz.
problems in efficiently handling variable-length binary files.
So, we'll do this first in BASIC, then BasWiz, for text files.
represent numbers with good precision is to use fractions.
course, but by now you've guessed that's always true!
(e.g., "3/2"), or whole number and fraction (e.g., "1 1/2").
(for instance, "5/10" will be reduced to "1/2").
8 x 8, 8 x 14, or 8 x 16.
*0 This is actually for text mode, not graphics mode.
case, use BC.EXE to compile the program directly.
*2 This non-standard VGA mode works on most ordinary VGAs.
on a VGA. See "Printer Routines".
adapter. 80x25 text remains available via PRINT.
on SuperVGAs based on the popular Tseng ET4000 chips.
which is common on SuperVGAs. See "VESA Info Routines".
differences between BASIC and the BasWiz routines.
specify the actual VESA mode number when setting the mode.
You may display the string starting at any graphics position.
depends on size of the font in use.
beforehand if this is a problem for you.
circle, just set both radius values to the same value.
hexagons, all the way up to full circles!
G#Polygon X%, Y%, Radius%, Vertices%, Angle!
angles (also the number of sides) for the polygon to have.
in radians. See "A Little Geometry" for more information.
actually exists, so you may wish to do this beforehand.
set the array to the appropriate size to hold the image.
The PUT replacement assumes that you intend to PSET the image.
initialized according to the settings in the .BMP file.
is used for controlling the background/border color and palette.
EGA or VGA systems that have been "locked" into CGA mode).
modes. The text-mode default is for blinking to be turned on.
With BASIC, you add 16 to the foreground color to make it blink.
doubles the number of available background colors.
Use -1 for blinking (default), or 0 to turn off blinking.
to get or set the palette colors.
immense variety of shades-- over 250,000 combinations in all.
between string and integer values.
created in order to help resolve this problem.
modes that the adapter is capable of handling.
a bit more than such sketchy minimalist compliance with VESA.
than 256 colors-- so BasWiz can't either. Sorry.
these numbers will be zero.
next" requests to find subsequent items.
The "find first" and "find next" routines return a mode number.
available VESA modes on your display.
use of VESA text modes.
usual setting in graphics modes.
These two return boolean values: -1 if true, 0 if false.
Scrolling in VESA modes is extremely slow. Avoid if possible.
text-mode support into the "graphics" routines.
work the same way as graphics mode. For one thing, each "pixel"
case you've already set up a desired mode.
statements SCREEN and WIDTH) before calling G0Mode with a zero.
should be true for any special EGA or VGA-based text modes.
plain MDA or a Hercules mono graphics adapter will do.
GN6SetBlock and GN6GetPel, but the functionality is the same.
assuming the usual 8.5" x 11" paper is used.
which may be in use by your program.
Getting a page layout just right can consume a lot of paper.
display versions of the same routines in that they don't scroll.
These routines only handle one page at a time.
will be meaningless if the font was never set with GN2Font.
computers in the first place?
for our applications, for the most part.
imaginary box (as GET and PUT do) with nice, clean boundaries.
away it is "as the crow flies".
construed from a Cartesian viewpoint.
back to our discussion of Polar coordinates.
accomplish something that would be difficult in either alone.
vertices is effectively a circle itself!
points using lines, which is easy in Cartesian coordinates.
Polar coordinates to Cartesian, draw the lines, and viola!
That's essentially the method used by the G#Polygon routines.
Etc" and ROSES.BAS for more information.
just use without understanding it.
are high, so a real circle looks like an ellipse.
maximum Y value to make it appear right-side-up.
(!), getting around such problems takes fiddlin'.
simplified-universe theoretical equations into practical use.
easier. So a few minor quirks can be ignored!
radius or distance from the origin, and A is the angle.
the same clock position as 3:00 pm.
graphics purposes, a simple 3.141593 should do quite nicely.
with a scientific bent (and/or nothing better to do)!
along with the center point. Do a FOR ANGLE! = 0 TO 2 * PI!
routines are primarily written in BASIC.
generated; if even, twice that number will be generated.
library or used book store.
most other languages, but was inexplicably left out of BASIC.
things, so I have added these capabilities to BasWiz.
faster and more memory-efficient than the alternatives.
and forth between a segment/offset address and a pointer.
0040:001C will turn into 0041:000C.
will do so. Meantime, that's the limit!
There are two routines which take care of memory management.
memory is available before going hog-wild.
returned. Otherwise, Ptr& will point to the allocated memory.
and finally deallocating the old block.
you use BASIC's VARSEG and VARPTR functions on the variable.
conflicts. MMove is a very efficient memory copying routine.
the arrays to move, so be cautious!
with an hourglass. Fortunately, we can do a lot better.
only plays in the foreground.
Timer routines, but channels 1-3 are entirely free for your use.
the background while your program does something else.
delay the timer can handle.
else, it will be more convenient to use the QTDelay routine.
bring in, whether the rest of the program needs it or not).
program to avoid possible conflicts.
you must multiply the time by 55 to compensate.
The PLAY statement works just like you'd expect, although "MB"
which contains a "BBS ANSI" interpreter.
comm port at a time.
settings are, unless you choose to specify your own settings.
The parity, word length, and stop bits can also be specified.
systems which may require unusual communications parameters.
carriage return and a linefeed added to the end of the string.
this delay simply by making the output buffer larger.
Function Call). I may add a music handler later to avoid this.
"dumb terminal" program to demonstrate the BasWiz comm handler.
get the handle) and the Protocol$ that you wish to use ("Xmodem"
depending on which the receiver requested.
routines work together in practice.
The file accessed by the Xmodem routine will remain open.
reason), using the FClose routine.
The DTR is generally the best way to disconnect. The Hayes "ATH"
command is supposed to hang up, but it doesn't work very well.
but it need only drop the DTR if you want it that way.
port unless the SHELLed program provides its own comm support.
for a very little bit of work.
includes almost all MS-DOS/PC-DOS computers in use today.
specify when to update the display from the shadow screen.
This makes changes appear very smoothly.
can be moved or resized.
tutorial approach, giving examples and explaining as I go along.
Take a look at the WDEMO.BAS program for examples.
WWriteLn Handle, "This is going on the background window."
WWriteLn Handle, "Right now, that's the full screen."
that we'll be using the BasWiz routines.
used WIDTH ,43 to go into 43x80 mode, you'd use "Rows = 43"
we choose "Handle = 0".
moves to the next line).
- At this point, only the shadow screen has been updated.
- We're all done with the program, so we end with WDone.
think of it as a virtual screen that's the size of the display.
screens, you can print to it without disturbing anything else.
portion of the virtual screen will be visible at any one time.
43x80 mode, though, the entire virtual screen will be visible!
easier to keep track of which is which.
- The cursor size is 0 (invisible).
- There is no title or frame.
entirely covered by other windows.
smoothly and at lightning speed.
predicament! How do we fix this?
routine allows us to change this.
despair. Play with it a little until you get the hang of it.
Don't forget to call WUpdate or the changes won't be visible!
text in the window would expand accordingly.
a title. Let's proceed to do just that.
middle columns, and lower right corner.
shadow off with either a null string or CHR$(0).
displayed. The maximum length of a title is 70 characters.
Titles have their own colors.
the change will only take effect after WUpdate is used.
they normally scroll the "screen" up to make room for more text.
specific window or virtual screen.
it on top, right? Hey, is this easy or what?!
put a frame and a title on a window and pop it onto the display.
disappoint you by leaving something fun like that out!
plain ol' ordinary window handler, there's an extra benefit.
displayed before you call either routine.
you can customize them just the way you want them.
virtual screen, though, besides printing to it with WWriteLn.
Let's take a look at what we can do.
outside the view port provided by the window, it will disappear.
adapter. This will always be at least eight.
display, you may be wondering what happens if the cursor is "on"
all the real work goes on behind the scenes!
All of the information that can be "set" can also be retrieved.
screen or its window. That's power!
key codes like arrow keys and function keys via ExtExitCode$.
can also use it to pass a default string to the routine.
ExitKey$ returns the key that was used to exit input.
Pop-up menus have become very popular in recent years.
Fortunately, they are a natural application for virtual windows!
bar indicating the current selection.
The pick list is passed to WMenuPopUp through a string array.
The current window colors will be used for the "normal" colors.
be used to abort without choosing an option.
or WCollapse if you prefer to get rid of it.
want to customize this routine!
Chances are, as a software developer you have a color display.
notebook-style computers with mono LCD or plasma screens.
as highlight bars still appear highlighted, however.
follow that as a standard.
BasWiz. Virtual screens are laid out like normal text screens.
automatically. This is subject to available memory, of course.
"out of memory" error will be generated (BASIC error number 7).
SETMEM function provided by QuickBasic.
Text mode or input buffering.
routines in particular are quite slow.
error code, it will simply ignore the value.
G#MirrorH will only work properly on images with byte alignment!
each interprets it to mean something different.
of the CGA display format.
element is the width and the second is the height, in pixels.
just over 16 Kbytes, or 16,400 bytes to be exact.
from the DOS command line (do not execute this by SHELL).
QB says "subprogram not defined".
so it knows to use the BasWiz library.
LINK says "unresolved external reference".
(like PATH, but for LIB files).
The virtual windowing system doesn't display anything.
"page zero" is supported on color monitors.
does, however, slow down 16-bit VGAs.
and recursive subprograms or functions.
problems are usually related either to "auto mode detection"
The BCD trig functions return weird results.
trig functions with high accuracy.
results are truncated or wrapped to one side.
routines, due to their use of floating point math.
on how to upgrade to the latest version.
LINKing. This bug has also been resolved in current versions.
to all BasWiz BASIC string functions and recompile them.
use any routines which require dynamic arrays with QBTiny.
test for any compatibility problems between it and BasWiz.
BASIC routines by Kerry Mitchell.
VGAKIT50.ZIP was the current version.
tech magazine, Dr. Dobb's Journal.
useless in accessing these modes).