Dec 222017
 
Library for PowerBASIC 3.x. Many functions, screen, data entry, string.
File PBTC13B.ZIP from The Programmer’s Corner in
Category BASIC Language
Library for PowerBASIC 3.x. Many functions, screen, data entry, string.
File Name File Size Zip Size Zip Type
CONSTANT.INC 1445 429 deflated
DEMO.BAS 12376 3424 deflated
DEMO.EXE 82943 34885 deflated
ORDER.FRM 4488 1698 deflated
PBTCLASS.DEC 3592 616 deflated
PBTCLASS.DOC 86240 12848 deflated
PBTCLASS.PBL 67754 18787 deflated
TPCREAD.ME 199 165 deflated

Download File PBTC13B.ZIP Here

Contents of the PBTCLASS.DOC file




About PBTools:Classic

PBTools:Classic is a library of PowerBASIC routines to help
programmers create professional looking programs without
having to spend the time to develop such routines on their
own. The shareware version contains the full
documentation and is fully functional. However, the
source code is supplied only to registered owners of
PBTools:Classic.

PBTools:Classic contains the windowing and screen I/O
functions from PBTools for those people who don't need the
whole package. Many routines have been revised to fix
bugs, enhance their usefulness, or "streamline" them for
minimum size.

Support:

Support for PBTools:Classic is provided by Creative Software
Alliance which can be reached by phone at (xxx) xxx-xxxx.

Warranty:

PBT:Lite is supplied AS IS, and there is no warranty of
any type expressed or implied, including, without
limitation, the warranties of merchantability and of the
fitness for any purpose. Neither the author nor the
publisher assume any liability for damages, direct or
consequential, which may result from the use of
PBTools:Classic.

Author's Note:

These routines were fully tested on several 80286 and
80386 clone systems with monochrome, EGA, and VGA setups,
and operated without any problems. I have left out error
handling routines in most of the library functions and
subs to make the routines run as fast as possible.

I have included the source code to the demo supplied with
PBT:Classic. I have done my best to add comments to help
with the usage for all commands. If you are still having
problems, please contact me through IMS by US Mail or
their BBS.








Page i



Acknowledgments:


I would like to thank Bob Zale for what I feel is the best
BASIC compiler available, and in many cases the best
compiler overall for any language.

The PBTools libraries have been tested by the following
people:

James Davis James Jarvis
Ronnie Pierce Alan Earnshaw
Scott Tucker

Documentation was re-written and formatted by James Davis.

Source code was reformatted by James Davis.

Dedications:

This library is dedicated to Jan and Jerry for putting up
with me while I kept them up nights pounding on the keyboard,
and for insisting I get out once and awhile to keep my
perspective on life.




























Page ii



T A B L E O F C O N T E N T S

About PBTools:Classic .................................... i
Support .................................................. i
Warranty ................................................. i
Author's Note ............................................ i
Acknowledgments .......................................... ii
Command Summary .......................................... v
AddShadow() ............................................. 1
Attr% ................................................... 2
Back%() ................................................. 3
Box() ................................................... 4
CapsOff ................................................. 5
CapsOn .................................................. 6
CapStat% ................................................ 7
ChangeWin() ............................................. 8
CheckKey% ............................................... 9
ClearWin ................................................ 10
CloseWin ................................................ 11
ClrKbd .................................................. 12
CurBot% ................................................. 13
CurDisplay% ............................................. 14
CurTop% ................................................. 15
DelChar$() .............................................. 16
Fill() .................................................. 17
Fore%() ................................................. 18
GetFrst$() .............................................. 19
GetKey$ ................................................. 20
GetScrn$() .............................................. 21
InitPBScreen ............................................ 22
InsChar$() .............................................. 23
InsertOff ............................................... 24
InsertOn ................................................ 25
InsStat% ................................................ 26
IsAlpha%() .............................................. 27
IsAlphaNum%() ........................................... 28
IsAlt% .................................................. 29
IsASCII%() .............................................. 30
IsCaps% ................................................. 31
IsCtrl% ................................................. 32
IsInsert% ............................................... 33
IsLShift% ............................................... 34
IsMouse% ................................................ 35
IsNum%() ................................................ 36
IsNumLock% .............................................. 37
IsPunct%() .............................................. 38
IsRShift% ............................................... 39
IsScroll% ............................................... 40
LPad$() ................................................. 41
LScroll() ............................................... 42
MaskIn() ................................................ 43
Menu%() ................................................. 44

Page iii


MLocate() ............................................... 45
MouseKey$ ............................................... 46
MouseOff ................................................ 47
MouseOn ................................................. 48
MouseStat() ............................................. 49
MouseWin() .............................................. 50
MoveWin() ............................................... 51
NoShadow ................................................ 52
NumIn() ................................................. 53
NumOff .................................................. 54
NumOn ................................................... 55
NumStat% ................................................ 56
OpenWin() ............................................... 57
PFirst() ................................................ 58
PutScrn() ............................................... 59
ReAttr() ................................................ 60
Recolor() ............................................... 61
RPad$() ................................................. 62
RScroll() ............................................... 63
ScrollDn() .............................................. 64
ScrollOff ............................................... 65
ScrollOn ................................................ 66
ScrollPrint() ........................................... 67
ScrollStat% ............................................. 68
ScrollUp() .............................................. 69
ScrollWin ............................................... 70
SetText() ............................................... 71
StuffKey() .............................................. 72
TextEd() ................................................ 73
TextIn() ................................................ 74
Title() ................................................. 75
Trim$() ................................................. 76
VidMode% ................................................ 77
VidSeg% ................................................. 78
WinColor() .............................................. 79
WPrint() ................................................ 80
WPrintC() ............................................... 81
WPrintCF() .............................................. 82
ZoomBox() ............................................... 83
Appendix ................................................. 84
Bibliography ............................................. 85













Page iv


PBTools:Classic Documentation

Command Summary:

AddShadow() - Adds a shadow to current window.
Attr% - Calculates a single integer from
foreground and background.
Back%() - Calculates background color from a
single integer.
Box() - Draws a box on the screen.
CapsOff - Toggles Caps Lock key off.
CapsOn - Toggles Caps Lock key on.
CapStat% - Returns status of Caps Lock key.
Center$() - Pad a string to the left and right with
spaces.
ChangeWin() - Changes the size of the current window.
CheckKey% - True if key in keyboard buffer.
ClearWin - Clears the contents of the current
window.
CloseWin - Closes a previously opened window.
ClrKbd - Clears keyboard buffer without removing
keys.
CurBot% - Bottom scanline of cursor.
CurDisplay% - Returns active display adaptor.
CurTop% - Top scanline of cursor.
DelChar$() - Deletes one character from a specified
string.
Fill() - Fills a box on the screen with a
character.
Fore%() - Calculates foreground color from an
integer.
GetFrst$() - Returns the first uppercase or number
character of a string.
GetKey$ - Get a single key from keyboard buffer,
wait if no key is present.
GetScrn$() - Places any portion of the screen into a
string.
InitPBScreen - Initialize all variables for window
routines.
InsChar$() - Inserts a character into a specified
string.
InsertOff - Toggles insert status off.
InsertOn - Toggles insert status on.
InsStat% - Returns status of INS key.
IsAlpha%() - Returns true if character is alpha (A-Z
or a-z).
IsAlphaNum%() - Returns true if character is
alphanumeric.
IsAlt% - True if ALT key is depressed.
IsASCII%() - Returns true if character is a printable
ASCII character.
IsCaps% - True if Caps Lock key is depressed.
IsCtrl% - True if Ctrl key is depressed.
IsInsert% - True if INS key is depressed.

Page v


PBTools:Classic Documentation

IsLShift% - True if Left Shift key is depressed.
IsMouse% - Returns number of buttons on mouse if
installed.
IsNum%() - Returns true if character is numeric.
IsNumLock% - True if Num Lock key is depressed.
IsPunct%() - Returns true if character is
punctuation.
IsRShift% - True if Right Shift key is depressed.
IsScroll% - True is Scroll Lock key is depressed.
LPad$() - Pads the left side of a string with a
character.
LScroll() - Scrolls any portion of the screen to the
left.
MLocate() - Locate the mouse cursor at any place on
screen.
MaskIn() - Get masked input from user.
Menu%() - Displays a menu and returns choice from
user.
MouseKey$ - Gets a key from keyboard, mouse movement
detected.
MouseOff - Turns mouse cursor off.
MouseOn - Turns mouse cursor on.
MouseStat() - Returns mouse position, and button
pressed.
MouseWin() - Define the window for mouse cursor.
MoveWin() - Moves the current window in any one of 4
directions.
NoShadow - Removes the shadow form the current
window.
NumIn() - Get numeric input from user.
NumOff - Toggles Num Lock key off.
NumOn - Toggles Num Lock Key on.
NumStat% - Returns status of Num Lock Key.
OpenWin() - Pops a window on the screen saving
whatever is underneath.
PFirst() - Print the first uppercase character of a
string highlighted.
PutScrn() - Puts a string created with GetScrn$()
back onto the screen.
RPad$() - Pads the right side of a string with a
character.
RScroll() - Scrolls any portion of the screen to the
right.
ReAttr() - Changes the color of any position on the
screen.
Recolor() - Changes color attribute of all positions
on screen.
ScrollDn() - Scrolls any part of the screen down.
ScrollOff - Toggles Scroll Lock key off.
ScrollOn - Toggles Scroll Lock key on.
ScrollPrint() - Scroll window up and print text on the
bottom of the window.

Page vi


PBTools:Classic Documentation

ScrollStat% - Returns the status of the scroll-lock
key.
ScrollUp() - Scrolls any part of the screen up.
ScrollWin - Scrolls the text within the current
window in one of 4 directions.
SetText() - Sets cursor color from single integer.
StuffKey() - Stuff the keyboard buffer with up to 16
characters.
TextEd() - Lets user edit the characters within a
line.
TextIn() - Gets ASCII input from user with editing
options.
Title() - Displays a title in one of 6 positions.
Trim$() - Removes spaces from the beginning and
end of a string.
VidMode% - Returns current video mode.
VidSeg% - Returns the segment of the video
address.
WPrint() - Displays a string within the current
window.
WPrintC() - Centers a text string horizontally
within the current window.
WPrintCF() - Print string centered in window with
first character highlighted.
WinColor() - Changes the text color of the current
window.
ZoomBox() - Explodes a box on the screen with noise
option.
























Page vii


PBTools:Classic Documentation

AddShadow() SUB Adds a shadow to current window

By using this sub-routine you can put a shadow in any of 2
predefined positions under the current active window using
either blank spaces or by changing the attributes of the
characters beneath the window.

Usage:
CALL AddShadow(Dir%)

Where Dir% = 1 for Drop Left shadow using black spaces
= 2 for Drop Right using black spaces
= 3 for Drop Left changing background attributes
= 4 for Drop Right changing background
attributes
See Also: NoShadow






































Page 1


PBTools:Classic Documentation

Attr% FUNCTION Calculate color integer

Calculates a single integer from foreground and background
values that you specify. Use this function to change colors
in any subroutine or function in PBTools:Classic that requires
a single integer color variable.

Usage:
Color% = Attr%(foreground%,background%)

Where Foreground% = Any color of the color table below.
Background% = Any color from 0 to 7 of color table.

Color Table:

0 - Black 8 - Grey
1 - Blue 9 - Light Blue
2 - Green 10 - Light Green
3 - Cyan 11 - Light Cyan
4 - Red 12 - Light Red
5 - Magenta 13 - Light Magenta
6 - Brown 14 - Yellow
7 - White 15 - Bright White

See Also: Back%(), Fore%(), ReAttr(), WinColor()





























Page 2


PBTools:Classic Documentation

Back%() FUNCTION Calculates background color

Calculates the background attribute from a single foreground/
background integer byte.

Usage:
Background% = Back%(ColorByte%)

See Also: Attr%, Fore%(), ReAttr(), WinColor()













































Page 3


PBTools:Classic Documentation

Box() SUB Draws a box on the screen

Draws a box on the screen with one of 14 borders types.

Usage:
CALL Box(Ypos%,Xpos%,Ylen%,Xlen%,Bor%,Shad%,BorC%,TextC%)

Where Ypos% = Top most row of the box
Xpos% = Left most column of the box
Ylen% = Total number of rows to draw the box in, not
including the shadow
Xlen% = Total number of columns to draw the box, not
including the shadow
Bor% = The selected border outline is one of the
following:
0 - No shadow
1 - Single line box
2 - Double line box
3 - Single sides/double top & bottom
4 - Double sides/single top & bottom
5 - Pulldown single box
6 - Pulldown double box
7 - Pulldown single top/double sides &
bottom
8 - Pulldown double top/single sides &
bottom
9 - Single top & bottom/no sides
10 - Double top & bottom/no sides
11 - Solid style 1
12 - Medium hatch
13 - Solid style 2
Shad% = Placement of shadow is one of the following:
1 - Drop Left shadow using black spaces
2 - Drop Right using black spaces
3 - Drop Left changing background
attributes
4 - Drop Right changing background
attributes
BorC% = Single integer for border color (see Attr%)
TextC% = Single integer for text color (see Attr%)

See Also: Attr%, ZoomBox()












Page 4


PBTools:Classic Documentation

CapsOff SUB Toggles Caps Lock key off

Toggles the Caps Lock key to its OFF state.

Usage:
CALL CapsOff

See Also: CapsOn, CapStat%














































Page 5


PBTools:Classic Documentation

CapsOn SUB Toggles Caps Lock key on

Toggles the Caps Lock key to its ON state.

Usage:
CALL CapsOn

See Also: CapsOff, CapStat%














































Page 6


PBTools:Classic Documentation

CapStat% FUNCTION Status of Caps Lock key

Returns a non-zero number if Caps Lock is on.

Usage:
IF CapStat% THEN CALL CapsOff

See Also: CapsOff, CapsOn














































Page 7


PBTools:Classic Documentation

ChangeWin() SUB Changes size of current window

Changes the size of the current window. There can be NO
shadow on the window when you resize it.

Usage:
CALL ChangeWin(Dir%)

Where Dir% = the direction that you want to resize.
If Dir% = 1 then adds to the right one position.
= 2 then removes from the right one position.
= 3 then adds to the bottom one row.
= 4 then removes from the bottom one row.

See Also: MoveWin()







































Page 8


PBTools:Classic Documentation

CheckKey% FUNCTION True if key is in keyboard buffer

Checks the keyboard buffer to see if a key is present without
removing it.

Usage:
IF CheckKey% THEN GOSUB GetAllKeys

See Also: ClrKbd, GetKey$, IsAlt%, IsCaps%, IsCtrl%,
IsInsert%, IsLShift%, IsNum%, IsRShift%, IsScroll%,
StuffKey()











































Page 9


PBTools:Classic Documentation

ClearWin SUB Clears contents of current window

Clears the contents of the current window.

Usage:
CALL ClearWin

See Also: OpenWin(), WinColor(), WPrint(), WPrintC(),
WPrintCF()













































Page 10


PBTools:Classic Documentation

CloseWin SUB Closes the current active window

Closes the current active window. DO NOT close a window
unless it is the last window you popped onto the screen,
otherwise you lose access to all windows following it.

Usage:
CALL CloseWin

See Also: OpenWin()












































Page 11


PBTools:Classic Documentation

ClrKbd SUB Clear all keys from KB buffer

Clears all keys from the keyboard buffer.

Usage:
CALL ClrKbd

See Also: CheckKey%, GetKey$, StuffKey()














































Page 12


PBTools:Classic Documentation

CurBot% FUNCTION Scanline for bottom of cursor

Returns a numeric value of the scanline for the bottom of the
cursor. The cursor need not be displayed when routine is
called.

Usage:
CursorBottom% = CurBot%

See Also: CurTop%












































Page 13


PBTools:Classic Documentation

CurDisplay% FUNCTION Returns the active video display

This function returns a numerical value of the type of active
video display found in the BIOS ROM.

Usage:
VidType% = CurDisplay%

Where 0 = Monochrome
1 = CGA
2 = EGA
3 = MCGA
4 = VGA

See Also: VidSeg%, VidMode%







































Page 14


PBTools:Classic Documentation

CurTop% FUNCTION Scanline for the top of cursor

Returns a numeric value of the scanline for the top of the
cursor.

Usage:
CursorTop% = CurTop%

See Also: CurBot%













































Page 15


PBTools:Classic Documentation

DelChar$() FUNCTION Delete a character from a string

Deletes one character from the user specified string.

Usage:
A$ = DelChar$(Tmp$, Xpos%)

Where Xpos% = The position of the character you wish to
delete.

See Also: InsChar$()











































Page 16


PBTools:Classic Documentation

Fill() SUB Fills box with given character

Fills a box on the screen with a given character and
background attribute.

Usage:
CALL Fill(Ypos%, Xpos%, Ylen%, Xlen%, Char%, Atr%)

Where Char% = Characters to fill box with
Atr% = Attribute to display character

See Also: Attr%, Box(), ReAttr(), Recolor










































Page 17


PBTools:Classic Documentation

Fore%() FUNCTION Calculates foreground color

Calculates foreground from a single color attribute integer.

Usage:
ForeGround% = Fore(Atr%)

See Also: Attr%, Back%()














































Page 18


PBTools:Classic Documentation

GetFrst$() FUNCTION Get the first char from a string

Returns the first valid alphanumeric character of a string.

Usage:
A$ = GetFrst$(Temp$)

See Also: PFirst(), WPrintCF()















































Page 19


PBTools:Classic Documentation

GetKey$ FUNCTION Get single key from KB buffer

Gets a single key from the keyboard buffer, waits if no key is
pressed. Does not return the status of the shift keys if they
are pressed individually.

Usage:
I$ = GetKey$

See Also: CheckKey%, ClrKbd, MaskIn(), MouseKey$, NumIn(),
TextEd(), TextIn()











































Page 20


PBTools:Classic Documentation

GetScrn$() FUNCTION Put screen portion into a string

Places any portion of the screen and it's color attributes in
a string.

Usage:
Top$ = GetScrn$(Ypos%, Xpos%, Xlen%)

See Also: PutScrn()













































Page 21


PBTools:Classic Documentation

InitPBScreen SUB Init all variables for windows

This command should be called upon before using any of the
windowing subroutines or functions. It initializes all
variables necessary for proper windowing to occur.

Usage:
CALL InitPBScreen

See Also: CloseWin, OpenWin()













































Page 22


PBTools:Classic Documentation

InsChar$() FUNCTION Insert single char into a string

Inserts a single character into a user specified string.

Usage:
A$ = InsChar$(Tmp$, Tmp2$, Xpos%)
Where Tmp$ = The string to be used
Tmp2$ = The character to insert into Tmp$
Xpos% = The position in Tmp$ where Tmp2$ should be
inserted.

See Also: DelChar$()










































Page 23


PBTools:Classic Documentation

InsertOff SUB Toggles Insert key off

Toggles the Insert key to its OFF state.

Usage:
CALL InsertOff

See Also: InsertOn, InsStat%, IsInsert%














































Page 24


PBTools:Classic Documentation

InsertOn SUB Toggles Insert key on

Toggles the Insert key to its ON state.

Usage:
CALL InsertOn

See Also: InsertOff, InsStat%, IsInsert%














































Page 25


PBTools:Classic Documentation

InsStat% FUNCTION Returns status of Insert key

Returns the status of the insert key. If it is ON it returns
a non-zero number.

Usage:
Status%=InsStat%

See Also: InsertOff, InsertOn, IsInsert%













































Page 26


PBTools:Classic Documentation

IsAlpha%() FUNCTION Tests if a character is alpha

Returns a non-zero number if a character passed to it is alpha
(A-Z or a-z).

Usage:
IF IsAlpha%(A$) THEN Yep

See Also: IsASCII%(), IsAlphaNum%(), IsNum%(), IsPunct%()













































Page 27


PBTools:Classic Documentation

IsAlphaNum%() FUNCTION Test if a char is alphanumeric

This function returns a non-zero value if the character passed
to it is an alphanumeric character.

Usage:
IF IsAlphaNum%(A$) THEN Yep

See Also: IsAlpha%(), IsASCII%(), IsNum%(), IsPunct%()













































Page 28


PBTools:Classic Documentation

IsAlt% FUNCTION True if Alt key is depressed

Returns a non-zero number if an Alt key is depressed.

Usage:
IF IsAlt% THEN AltKeyPressed

See Also: GetKey$, IsCaps%, IsCtrl%, IsInsert%, IsLShift%,
IsNumLock%, IsRShift%













































Page 29


PBTools:Classic Documentation

IsASCII%() FUNCTION Test if a char is printable ASCII

This function returns a non-zero number if the character
passed to it is a printable ASCII character. Valid characters
range from 32 to 126.

Usage:
IF IsASCII%(A$) THEN Yep

See Also: IsAlpha%(), IsAlphaNum%(), IsNum%(), IsPunct%()












































Page 30


PBTools:Classic Documentation

IsCaps% FUNCTION True if Caps Lock key is pressed

Returns a non-zero number if the Caps Lock key is depressed.

Usage:
IF IsCaps% THEN Yep

See Also: GetKey$, IsAlt%, IsCtrl%, IsInsert%, IsLShift%,
IsNumLock%, IsRShift%













































Page 31


PBTools:Classic Documentation

IsCtrl% FUNCTION True if Ctrl key is depressed

Returns a non-zero number if a Ctrl key is depressed.

Usage:
IF IsCtrl% THEN Yep

See Also: GetKey$, IsAlt%, IsCaps%, IsInsert%, IsLShift%,
IsNumLock%, IsRShift%













































Page 32


PBTools:Classic Documentation

IsInsert% FUNCTION True if Insert key is depressed

Returns a non-zero number if the Insert key is depressed.

Usage:
IF IsInsert% THEN Yep

See Also: GetKey$, IsAlt%, IsCaps%, IsCtrl%, IsLShift%,
IsNumLock%, IsRShift%













































Page 33


PBTools:Classic Documentation

IsLShift% FUNCTION True if Left Shift key is pressed

Returns a non-zero number if the Left Shift Key is depressed.

Usage:
IF IsLShift% THEN Yep

See Also: IsRShift%














































Page 34


PBTools:Classic Documentation

IsMouse% FUNCTION Number of buttons on a mouse

Returns the number of buttons a mouse has if one is installed.

Usage:
IF IsMouse% THEN Buttons%=IsMouse%

See Also: MLocate(), MouseKey$, MouseOff, MouseOn,
MouseStat(), MouseWin()













































Page 35


PBTools:Classic Documentation

IsNum%() FUNCTION Test if character is a number

This function returns a non-zero number if the character
passed to it is a number character. The characters evaluated
are "0" [CHR$(48)] thru "9" [CHR$(57)].

Usage:
IF IsNum%(A$) THEN Yep

See Also: IsAlpha%(), IsAlphaNum%(), IsASCII%(), IsPunct%()












































Page 36


PBTools:Classic Documentation

IsNumLock% FUNCTION True if Num Lock key is pressed

Returns a non-zero number if the Num Lock key is depressed.

Usage:
IF IsNumLock% THEN Yep

See Also: GetKey$, IsAlt%, IsCaps%, IsCtrl%, IsInsert%,
IsLShift%, IsRShift%













































Page 37


PBTools:Classic Documentation

IsPunct%() FUNCTION Test if a char is punctuation

This function returns a non-zero number if a character is a
valid punctuation symbol. Valid punctuation symbols are:
[email protected]#$%^&*(),.:;'"?/\[]{}-+=<>

Usage:
IF IsPunct%(A$) THEN Yep

See Also: IsAlpha%(), IsAlphaNum%(), IsASCII%(), IsNum%()












































Page 38


PBTools:Classic Documentation

IsRShift% FUNCTION True if Right Shift is pressed

Returns a non-zero number if the Right Shift key is depressed.

Usage:
IF IsRShift% THEN Yep

See Also: GetKey$, IsAlt%, IsCaps%, IsCtrl%, IsInsert%,
IsLShift%, IsNumLock%














































Page 39


PBTools:Classic Documentation

IsScroll% FUNCTION True if Scroll Lock is pressed

Returns a non-zero number if the Scroll Lock key is depressed.

Usage:
IF IsScroll% THEN Yep

See Also: GetKey$, IsAlt%, IsCaps%, IsCtrl%, IsInsert%,
IsLShift%, IsNumLock%













































Page 40


PBTools:Classic Documentation

LPad$() FUNCTION Pad left side of string with char

This function will pad the left side of a string with any user
defined character.

Usage:
A$ = LPad$(Lin$, Length%, Char%)

Where Lin$ = The string you wish to pad.
Length% = How many characters to pad the left side
of the string with.
Char% = The ASCII value of the character you
wish to pad the string with.

See Also: RPad$(), Trim$()







































Page 41


PBTools:Classic Documentation

LScroll() SUB Scrolls portion of screen left

Scrolls any portion of the screen to the left.

Usage:
CALL LScroll(TopRow%,LeftCol%,BotRow%,RightCol%,Cols%,Atr%)

See Also: RScroll(), ScrollDn(), ScrollUp(), ScrollWin














































Page 42


PBTools:Classic Documentation

MaskIn() SUB Gets masked input from the user

By specifying a Mask$ you may get input only in the areas
where you wish.

Usage:
CALL MaskIn(Ypos%,Xpos%,TexCol%,Hilite%,Mask$,Deflt$,Term$)

Where TexCol% = The color of the text when editing is
done
Hilite% = The color of the text as it is edited
Mask$ = The desired mask to use for getting
input. The following characters can be
used in defining a Mask$:
_ = Any character
@ = Alpha characters only (Upper and
Lower)
# = Numeric characters only
! = Uppercase Alpha only
| = Alpha and numeric only (Uppercase)
Deflt$ = The default answer for input.
Term$ = The terminating key returned for
editing.

See Also: GetKey$, MouseKey$, NumIn(), TextEd(), TextIn()





























Page 43


PBTools:Classic Documentation

Menu%() FUNCTION Vertical menu to get use choice

Displays a menu with a moveable scroll bar and allows user to
either choose a selection with the first letter of the menu
selection or by pressing Enter.

Usage:
Choice%=Menu%(Choices$(),Ypos%,Ylen%,Current%,Hilite%,Typ%)

Where Choices$() = Choices to display.
Ypos% = The starting row to the display
menu relative to the current open
window.
Ylen% = The number of the choices to
display. If all choices cannot be
displayed then remaining choices
will be scrolled onto the screen.
Current% = The default choice to hilite
first.
Hilite% = The color to display the current
choice.
Typ% = Defines the type of menu. If zero
the menu will be non-hotkey, any
other value defaults to hotkey
type menu allowing for first
letter of selection to be pressed
ending routine.

See Also: OpenWin()

























Page 44


PBTools:Classic Documentation

MLocate() SUB Locates mouse cursor on screen

Locates the mouse cursor to a desired position on the screen.

Usage:
CALL MLocate(Ypos%,Xpos%)

See Also: IsMouse%, MouseOff, MouseOn, MouseStat()














































Page 45


PBTools:Classic Documentation

MouseKey$ FUNCTION Gets input from mouse buttons

Gets keyboard input from user. If mouse is attached, mouse
movements are also used.

Usage:
I$=MouseKey$
Left Button = Enter
Right Button = Esc

See Also: GetKey$, IsMouse%











































Page 46


PBTools:Classic Documentation

MouseOff SUB Turns mouse cursor off

Turns the mouse cursor OFF so that it is hidden and not
displayed on the screen.

Usage:
CALL MouseOff

See Also: IsMouse%, MouseOn, MouseStat()













































Page 47


PBTools:Classic Documentation

MouseOn SUB Turns mouse cursor on

Turns the mouse cursor ON so it is visible on the screen.

Usage:
CALL MouseOn

See Also: IsMouse%, MouseOff, MouseStat()














































Page 48


PBTools:Classic Documentation

MouseStat() SUB Gets status of mouse buttons

Returns the status of the mouse buttons if one is installed.

Usage:
CALL MouseStat(Button%, Ypos%, Xpos%)

Where Button% = Current button(s) depressed

See Also: IsMouse%, MouseOff, MouseOn












































Page 49


PBTools:Classic Documentation

MouseWin() SUB Defines window for mouse cursor

Defines the window for the mouse cursor to be displayed in.

Usage:
CALL MouseWin(Ypos%, Xpos%, Ylen%, Xlen%)

See Also: IsMouse%, MouseOff, MouseOn, MouseStat()














































Page 50


PBTools:Classic Documentation

MoveWin() SUB Moves current active window

Moves the current active window on the screen.

Usage:
CALL MoveWin(Dir%)

Where if Dir% = 1 then moves window Right one position.
= 2 then moves window Left one position.
= 3 then moves window Down one position.
= 4 then moves window Up one position.

See Also: NoShadow, OpenWin()










































Page 51


PBTools:Classic Documentation

NoShadow SUB Remove shadow from current window

Removes the shadow from the current window. (Required when
moving or resizing windows)

Usage:
CALL NoShadow

See Also: AddShadow(), ChangeWin(), MoveWin()













































Page 52


PBTools:Classic Documentation

NumIn() SUB Gets numeric input from user

Gets numeric input from the user with text editing features.

Usage:
CALL NumIn(Ypos%,Xpos%,Dgts%,NumCol%,Hilite%,Answer#,Term$)

Where Dgts% = Numbers after decimal point
NumCol% = Color of text after input
Answer# = Double precision real number
with input
Term$ = Key used to terminate input

See Also: GetKey$, MaskIn(), TextEd(), TextIn()








































Page 53


PBTools:Classic Documentation

NumOff SUB Toggles Num Lock key off

Toggles the Num Lock key to its OFF state.

Usage:
CALL NumOff

See Also: NumOn














































Page 54


PBTools:Classic Documentation

NumOn SUB Toggles Num Lock key on

Toggles the Num Lock key to its ON state.

Usage:
CALL NumOn

See Also: NumOff














































Page 55


PBTools:Classic Documentation

NumStat% FUNCTION True if Num Lock key is on

Returns a non-zero number if Num Lock is on.

Usage:
IF NumStat% THEN Yep

See Also: NumOff, NumOn














































Page 56


PBTools:Classic Documentation

OpenWin() SUB Pops window on screen

Pops a window on the screen saving all contents underneath.

Usage:
CALL OpenWin(Ypos%,Xpos%,YLen%,Xlen%,Brdr%,BrC%,TxC%,Shd%,_
Zm%,Ns%)

Where Brdr% = Border selection (see Box()).
BrC% = The color attribute for the
border.
TxC% = The color attribute for text.
Shd% = The placement of the shadow (see
Box()).
Zm% = True - zoom the window onto the
screen.
Ns% = True - make noise when opening
window.

See Also: Box(), CloseWin


































Page 57


PBTools:Classic Documentation

PFirst() SUB Prints string, first char hilited

Prints a user specified string with the first valid character
of that string highlighted.

Usage:
CALL PFirst(Temp$, TextC%, HltC%)

Where Temp$ = The text to be printed.
TextC% = The one byte color of the text to be
printed (See Attr%).
HltC% = The one byte color of the highlighted
text (See Attr%).

See Also: Attr%, SetText()







































Page 58


PBTools:Classic Documentation

PutScrn() SUB Put captured string on screen

Puts a string created with GetScrn$() back onto the screen.

Usage:
CALL PutScrn(Ypos%, Xpos%, Text$)

See Also: GetScrn$()














































Page 59


PBTools:Classic Documentation


ReAttr() SUB Changes color attribute

Changes the color attribute of any position on the screen.

Usage:
CALL ReAttr(Ypos%, Xpos%, Ylen%, Ypos%, NewColor%)

See Also: Attr%, Fill(), Recolor














































Page 60


PBTools:Classic Documentation

Recolor() SUB Changes color attribute of screen

Changes the color attribute of all positions on the screen.

Usage:
CALL Recolor(Old%, New%)

Where Old% = the attribute on the screen you want to
change.
New% = the attribute on the screen to replace the
Old% attribute with.

See Also: Attr%, Fill(), ReAttr()









































Page 61


PBTools:Classic Documentation

RPad$() SUB Pads right of string with a char

Pads the right side of a string with a user specified
character as many times as you wish.

Usage:
A$ = RPad$(Lin$, Length%, Char%)

Where Lin$ = The string you wish to pad.
Length% = How many characters to pad the right side of
the string with.
Char% = The ASCII value of the character you wish
to pad the string with.

See Also: LPad$(), Trim$()







































Page 62


PBTools:Classic Documentation

RScroll() SUB Scrolls portion of screen right

Scrolls any portion of the screen to the right.

Usage:
CALL RScroll(TopRow%,LeftCol%,BotRow%,RightCol%,Cols%,Atr%)

See Also: LScroll(), ScrollDn(), ScrollUp(), ScrollWin














































Page 63


PBTools:Classic Documentation

ScrollDn() SUB Scrolls portion of screen down

Scrolls any part of the screen down one line.

Usage:
CALL ScrollDn(Left%, Right%, Top%, Bottom%, Rows%, Atr%)

Where Left% = The left corner of the screen
Right% = The right corner of the screen
Top% = The top most line to scroll
Bottom% = The bottom most line to scroll
Rows% = The number of rows to scroll
Atr% = The color attribute to use

See Also: Attr%, ScrollUp(), ScrollWin







































Page 64


PBTools:Classic Documentation

ScrollOff SUB Toggles Scroll Lock key off

Toggles the Scroll Lock key to its OFF state.

Usage:
CALL ScrollOff

See Also: ScrollOn, ScrollStat%














































Page 65


PBTools:Classic Documentation

ScrollOn SUB Toggles Scroll Lock key on

Toggles the Scroll Lock key to its ON state.

Usage:
CALL ScrollOn

See Also: ScrollOff, ScrollStat%














































Page 66


PBTools:Classic Documentation

ScrollPrint() SUB Scroll window up and print string

This sub-routine scrolls the window up one position and prints
the user specified text at the bottom of that window.

Usage:
CALL ScrollPrint(Text$)

See Also: ScrollDn(), ScrollUp(), ScrollWin













































Page 67


PBTools:Classic Documentation

ScrollStat% SUB True if Scroll Lock key is on

Returns a non-zero number if Scroll Lock is on.

Usage:
IF ScrollStat% THEN Yep

See Also: ScrollOff, ScrollOn














































Page 68


PBTools:Classic Documentation

ScrollUp() SUB Scrolls portion of screen up

Scrolls any portion of the screen up one line.

Usage:
CALL ScrollUp(Left%, Right%, Top%, Bottom%, Rows%, Atr%)

See Also: Attr%, ScrollDn(), ScrollWin














































Page 69


PBTools:Classic Documentation

ScrollWin SUB Scroll the window

Scrolls the current window up, down, left or right.

Usage:
CALL ScrollWin(Dir%)

Where if Dir% = 1 then scrolls window Down.
= 2 then scrolls window Up.
= 3 then scrolls window Left.
= 4 then scrolls window Right.

See Also: OpenWin(), ScrollDn(), ScrollUp()









































Page 70


PBTools:Classic Documentation

SetText() SUB Sets cursor color from attribute

Set the cursor color from an attribute created by the Attr%()
function.

Usage:
CALL SetText(Atr%)

See Also: Attr%, Back%(), Fore%()













































Page 71


PBTools:Classic Documentation

StuffKey() SUB Stuffs keyboard buffer

Stuffs the keyboard buffer with up to 16 characters. May not
work with many keyboard enhancers.

Usage:
CALL StuffKey(Text$)

See Also: ClrKbd, GetKey$, MouseKey$













































Page 72


PBTools:Classic Documentation

TextEd() SUB Lets user edit chars in a string

Allows user to edit a string that is passed to the routine
using all text editing features.

Usage:
CALL TextEd(Ypos%, Xpos%, Cpos%, TxC%, Hl%, Txt$, Term$)

Where Cpos% = Cursor position within the string
TxC% = The normal text color
Hl% = The highlighted text color
Txt$ = The text to edit
Term$ = The terminating key that ended the routine

See Also: GetKey$, MaskIn(), NumIn(), TextIn()







































Page 73


PBTools:Classic Documentation

TextIn() SUB Gets text input from the user

Get input from the user with all text editing features.

Usage:
CALL TextIn(Ypos%, Xpos%, Max%, TxC%, Hl%, Txt$, Term$)

Where Max% = The maximum characters to allow in Txt$

See Also: GetKey$, MaskIn(), NumIn(), TextEd()












































Page 74


PBTools:Classic Documentation

Title() SUB Puts title on current window

Displays a title on current window in a desired color.

Usage:
CALL Title(Position%, TCol%, Title$)

Where Position% = Placement of title on window.
1 = top left.
2 = top center.
3 = top right.
4 = bottom left.
5 = bottom center.
6 = bottom right.
TCol% = The color attribute of text to print.

See Also: Attr%, OpenWin(), WPrint(), WPrintC()





































Page 75


PBTools:Classic Documentation

Trim$() FUNCTION Trim spaces from ends of string

Trims all spaces from the left and right side of a given
string.

Usage:
A$ = Trim$(A$)

See Also: LPad$(), RPad$()













































Page 76


PBTools:Classic Documentation

VidSeg% FUNCTION Segment for video I/O on display

Returns the segment for video I/O on active display.

Usage:
PRINT "The video segment is located at"; HEX$(VidSeg%)

See Also: CurDisplay%, VidMode%














































Page 77


PBTools:Classic Documentation

VidMode% FUNCTION Video mode for current display

Returns the video mode for current display.

Usage:
PRINT "Current Video Mode is"; VidMode%

See Also: CurDisplay%, VidSeg%














































Page 78


PBTools:Classic Documentation

WinColor() SUB Set text color of current window

Changes the default text color of the current window.

Usage:
CALL WinColor(Atr%)

See Also: Attr%, Back%(), Fore%(), OpenWin(), WPrint(),
WPrintC()













































Page 79


PBTools:Classic Documentation

WPrint() SUB Prints string in current window

Prints a string within the current window in desired color.

Usage:
CALL WPrint(Ypos%, Xpos%, Text$, Atr%)

Where Ypos% and Xpos% are relative to the top right
corner of the window which is considered to be
point 0,0.

See Also: Attr%, OpenWin(), WPrintC()










































Page 80


PBTools:Classic Documentation

WPrintC() SUB Prints centered string in window

Prints a string centered horizontally within the current
window in the desired color.

Usage:
CALL WPrintC(Ypos%, Text$, Atr%)

See Also: Attr%, OpenWin(), WPrint()













































Page 81


PBTools:Classic Documentation

WPrintCF() SUB Center string with hilited char

This subroutine will print the user specified string centered
within the current window with the first character
highlighted.

Usage:
CALL WPrintCF(Lin%, Text$, Atr%)

Where Lin% = The position relative to the active window
where the string is to be printed.
Text$ = The string to be printed.
Atr% = The color to print the highlighted portion
of the text with. (See Attr%)

See Also: Attr%, WPrint(), WPrintC()






































Page 82


PBTools:Classic Documentation

ZoomBox() SUB Zooms a box onto the screen

Zooms a box onto the screen with option for noise.

Usage:
CALL ZoomBox(Ypos%,Xpos%,Ylen%,Xlen%,BDr%,Sh%,BrC%,TxC%,Ns%)

Where BrC% = The color attribute of the border.
TxC% = The color attribute of the window's text.
Ns% = A non-zero number if you wish for the
window to make noise while zooming onto the
screen.

See Also: Box(), OpenWin()








































Page 83


Appendix


A L
AddShadow 1; 52 LPad 41; 62,76
Attr 2; 3,4,17,18 LScroll 42; 63

B M
Back 3; 2,18,71,79 MLocate 43; 35
Box 4; 17,57,82 MaskIn 44; 20,53,73,74
Menu 45
C MouseKey 46; 20,35,43,72
CapsOff 5; 6,7 MouseOff 47; 35,45,48-50
CapsOn 6; 5,7 MouseOn 48; 35,45,47,50
CapStat 7; 5,6 MouseStat 49; 35,45,47-50
ChangeWin 8; 52 MouseWin 50; 35
CheckKey 9; 12,20 MoveWin 51; 8,52
ClearWin 10
CloseWin 11; 22,57 N
ClrKbd 12; 9,20,72 NoShadow 52; 1,51
CurBot 13; 15 NumIn 53; 20,43,73,74
CurDisplay 14; 77,78 NumOff 54; 55,56
CurTop 15; 13 NumOn 55; 54,56
NumStat 56
D
DelChar 16; 23 O
OpenWin 57; 10,11,22,44
F
Fill 17; 60,61 P
Fore 18; 2,3,71,79 PFirst 58; 19
PutScrn 59; 21
G
GetFrst 19 R
GetKey 20; 9,12,31-33 RPad 60; 41,76
GetScrn 21; 59 RScroll 61; 42
ReAttr 62; 2,3,17,61
I Recolor 63; 17,60
InitPBScreen 22
InsChar 23; 16 S
InsertOff 24; 25,26 ScrollDn 64; 42,63,67,69
InsertOn 25; 24,26 ScrollOff 65; 66,68
InsStat 26; 24,25 ScrollOn 66; 65,68
IsAlpha 27; 28,30,36,38 ScrollPrint 67
IsAlphaNum 28; 27,30,36,38 ScrollStat 68; 65,66
IsAlt 29; 9,31-33,37 ScrollUp 69; 42,63,64,67
IsASCII 30; 27,28,36,38 ScrollWin 70; 58
IsCaps 31; 9,29,32,33 SetText 71; 9,12
IsCtrl 32; 9,29,31,33 StuffKey 72;
IsInsert 33; 9,24-26,29
IsLShift 34; 9,29,31-33 T
IsMouse 35; 45-50 TextEd 73; 20,43,53,74
IsNum 36; 9,27,28,30 TextIn 74; 20,43,53,73
IsNumLock 37; 29,31-33,39 Title 75
IsPunct 38; 27,28,30,36 Trim 76; 41,62
IsRShift 39; 9,29,31-34
IsScroll 40; 9
Page 84


Appendix

V
VidSeg 77; 14,78
VidMode 78; 14,77
W
WPrint 79; 10,75,79,81
WPrintC 80; 10,75,29,80
WPrintCF 81; 10,19
WinColor 82; 2,3,10

Z
ZoomBox 83











































Page 85





Bibliography

Advanced Assembly Language; by Steven Holzner and Peter Norton;
Published by Brady; ISBN 0-13-663014-6

Assembly Language Subroutines for MS-DOS, 2nd Edition; by Leo J.
Scanlon; Published by Windcrest; ISBN 0-8306-7649-X

The BASIC Handbook, 3rd Edition; by Davis A. Lien; Published by
CompuSoft; ISBN 0-932760-33-3

Computer Language Magazine; Published by Miller Freeman

Dr. Dobb's Journal; Published by M&T Publishing

Extending DOS; by Ray Duncan, Charles Petzold, M. Steven Baker,

Andrew Schulman, Stephen R. Davis, Ross P. Nelson, and Robert Moote;
Published by Addison Wesley; ISBN 0-201-55053-9

Logitech Mouse User's Manual; Published by Logitech

PC Interrupts; by Ralf Brown and Jim Kyle; Published by Addison
Wesley; ISBN 0-201-57797-6

PC Magazine; Published by Ziff-Davis

The Programmer's PC Sourcebook, 2nd Edition; by Thom Hogan;
Published by Microsoft Press; ISBN 1-55615-321-X

Programmer's Problem Solver for the IBM PC, XT & AX; by Robert
Jourdain; Published by Brady; ISBN 0-89303-787-7

The Ultimate DOS Programmer's Manual; by John Mueller and Wallace
Wang; Published by Windcrest; ISBN 0-8306-3534-3

Undocumented DOS, Second Edition; by Andrew Schulman, Raymond J.
Michels, Jim Kyle, Tim Paterson, David Maxey, and Ralf Brown;
Published by Addison Wesley; ISBN 0-201-57064-5

Using Assembly Language, 2nd Edition; by Allen L. Wyatt; Published
by QUE; ISBN 0-88022-464-9

The Waite Group's Turbo Assembler Bible; by Gary Syck; Published by
SAMS; ISBN 0-672-22716-9









Page 86


 December 22, 2017  Add comments

Leave a Reply