home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
291_01
/
jjb_read.doc
< prev
next >
Wrap
Text File
|
1989-06-28
|
84KB
|
2,068 lines
=====================================================================
*** JJB 1.2 for QUICK C and TURBO C programmers ***
=====================================================================
Welcome, Turbo C and Quick C programmers, to JJB 1.2
JJB is a high-level programming environment you may use under the
Shareware concept to program ANY PROGRAMMING APPLICATION including:
graphics, communication, data base, utilities, etc. The code is tight
and executes your program fast.
JJB 1.2 is the first in a series of software products I am writing
which enables the 'C' programmer to write professional looking
programs in minutes instead of taking days, weeks, or even months.
I hope you enjoy using JJB and I welcome you to become a registered
user so you can share in all the advantages that programming with JJB
has to offer. I am currently working on my next release JJB LA (Large
Application).
JOHN JAMES BRODERICK
JJB
9236 Church Rd, Suite 1082
Dallas, Tx 75231
(214) 341-1635
______________________________________________________________________
Copyright (c) 1988, 1989. JJB All rights reserved.
Quick C is a trademark of Microsoft Corp.
Turbo C is a trademark of Borland International, Inc.
_______________________________________________________________________
************************************************
* *
* CONTENTS OF THIS FILE *
* *
* 1. JJB OVERVIEW. What is JJB ? *
* 2. WHERE DID THE IDEA OF JJB COME FROM? *
* 3. SUMMARY OF DOCUMENTATION, *
* INSTALLATION, and *
* REGISTRATION. *
* 4. JJB FILES LISTED & EXPLAINED. *
* 5. QUICK C LEARNING INSTALLATION. *
* 6. QUICK C FINAL INSTALLATION. *
* 7. TURBO C LEARNING INSTALLATION. *
* 8. TURBO C FINAL INSTALLATION. *
* 9. JJB FUNCTIONS LISTED & EXPLAINED. *
* 10. REGISTRATION FORM. *
* *
************************************************
======================================================================
*** JJB 1.2 for QUICK C and TURBO C programmers ***
======================================================================
JJB 1.2
1. New, different, unique.
2. A high-level, C programming environment.
3. Professionally written and completely documented.
4. Designed for Quick C and Turbo C programmers.
5. JJB 1.2 is included with this literature and
is ready to use.
6. Easy to install. Easy to begin using.
7. Executes your program fast--direct memory access.
8. Makes your program portable:
Runs on IBM PC, XT, AT 286, 386 and compatible
computers with monochrome, CGA, EGA, VGA, etc.
9. Allows C programs to be written in minutes.
10. Distributed under the Shareware concept.
JJB is a foundation of functions from low-level to high-level upon
which you can build your program. The functions execute fast and are
coded tight to conserve memory for your program. With them, you can
program in an extreme high-level 'C' environment maintaining complete
low-level control over your program.
JJB automatically handles many things for you such as making pull-down
menus, testing each keypress, handling color attributes for the
different video modes, changing from one option to another, and many
more routine tasks you should not have to do.
JJB actually executes (runs) your program. JJB handles every keypress
in your program. From any option in your program, you can select, and
go to any other option. Each option can be initalized and exited with
a function. You never have to test a keypress.
=====================================================================
*** FOR CLUBS AND COMPANIES DISTRIBUTING SHAREWARE SOFTWARE ***
=====================================================================
This is the complete JJB 1.2 programming environment designed
especially for QUICK C and TURBO C programmers.
JJB is a programming environment which allows the 'C' programmer to
easily and quickly write professional looking programs.
I am the author and you have my permission to freely circulate it
under the Shareware concept as long as you do not add, delete or
change JJB files.
The documentation is complete with over 50 pages including five
sample source files all of which can be printed with one dos command.
Installation is as easy as placing the diskette in drive a: and
entering the installation command. Within one minute it will be
installed. There is a learning installation, a final installation and
even a reverse installation for keeping your hard disk free of
unnecessary files.
This file 'JJB-READ.DOC' explains everything the QUICK C and TURBO C
programmer needs to get started. All documentation can be printed from
dos by entering 'JJBPRINT'.
John James Broderick
JJB
9236 Church Rd, Suite 1082
Dallas, Tx. 75231
(214) 341-1635
======================================================================
*** JJB 1.2 for QUICK C and TURBO C programmers ***
----------------------------------------------------------------------
*** Distributed under the Shareware concept. Registration $49 ***
======================================================================
JJB
9236 Church Rd, Suite #1082
Dallas, Texas 75231
(214) 341-1635
USE JJB TO WRITE QUICK C AND TURBO C PROGRAMS FAST. JJB
HANDLES EXECUTING YOUR PROGRAM FUNCTIONS. IT AUTOMATICALLY
DOES YOUR PULL-DOWN MENUS, OPTION SELECTION, FAST WINDOWING,
ENTRY INPUT, AND IS 100% PORTABLE. ANY BEGINNING 'C'
PROGRAMMER CAN START USING JJB IN MINUTES.
JJB IS A SET OF FUNCTIONS AND ARRAYS WHICH HOLDS INFORMATION
ABOUT YOUR PROGRAM OPTIONS. EACH OPTION CAN BE ASSIGNED A
STRING DESCRIPTION AND A FUNCTION NAME. THEY ARE GROUPED
TOGETHER TO FORM PULL-DOWN MENUS AND BOTH OPTIONS AND GROUPS
CAN BE INITALIZED AND EXITED WITH PROGRAM FUNCTIONS.
FROM ANY OPTION IN YOUR PROGRAM, YOU CAN SELECT ANY OTHER
OPTION BY PRESSING 'ALT' AND MAKING A SELECTION FROM THE
PULL-DOWN MENUS, OR YOU CAN PRESS AN ASSIGNED FUNCTION KEY
GOING DIRECTLY TO THE OPTION. JJB HANDLES CHANGING OPTIONS
BY EXECUTING THE FUNCTION FOR THE OPTION SELECTED.
JJB IS DESIGNED SO THE SOFTWARE YOU WRITE TODAY WILL RUN ON
EVERY IBM PC, XT, AT 286, 386 AND COMPATIBLE COMPUTER AND ON
ALL VIDEO CONTROLLERS MONOCHROME, CGA, EGA, VGA, ETC, PLUS
IT SHOULD ALSO RUN ON UPWARD-COMPATIBLE COMPUTERS MADE IN
THE FUTURE.
FEATURES INCLUDE: DIRECT MEMORY ACCESS--OVER 30 'VIDEO FAST'
'VF' FUNCTIONS PROGRAMMED FOR TIGHT, PORTABLE KILLER SPEED,
EASY COLORING AND WINDOWING, COMPLETE SET OF KEYBOARD
FUNCTIONS FOR HIGH-LEVEL DATA ENTRY, KEYBOARD TESTING IS ALL
AUTOMATIC AND DONE BY JJB, YET YOU CAN OVERRIDE FOR
LOW-LEVEL CONTROL.
YOU CAN GENERATE INTERNAL USER KEYPRESSES, INPUT FUNCTIONS
CAN EDIT FROM/TO INPUT RANGES, ENTER FUNCTIONS DIRECTLY
UPDATE DATA BUFFERS, GET AND SET FUNCTIONS ALLOW LOW-LEVEL
CONTROL TO ACCESS OR CHANGE SWITCHES AND VARIABLES. JJB
PROVIDES A HIGH-LEVEL PROGRAMMING ENVIRONMENT FOR THE
BEGINNING 'C' PROGRAMMER AND LOW-LEVEL CONTROL FOR THE
ADVANCED PROGRAMMER.
REGISTRATION IS $49. PLUS $3. SHIPPING. REGISTERING ENTITLES
YOU TO RECEIVE THE LATEST VERSION OF ALL JJB SOFTWARE, THE
JJB MANUAL (THE COMPLETE PRINTED DOCUMENTATION), SOURCE CODE
WITH COMMENTS FOR ALL INPUT AND ENTER FUNCTIONS, FREE
TECHNICAL SUPPORT, AND THE JJB NEWSLETTER.
======================================================================
*** Where did the idea of JJB for 'C' come from ? ***
----------------------------------------------------------------------
*** From a 1988 INCOME TAX PACKAGE written in FORTH. ***
======================================================================
JJB FOR 'C' PROGRAMMERS REPRESENTS THE BEST OF WHAT I KNOW
AND WHAT I HAVE PROGRAMMED SINCE I WROTE THE FIRST ASSEMBLY
LANGUAGE TRACE, STEP, BREAKPOINT DEBUGGER FOR THE APPLE II
COMPUTER IN 1979. IT WAS KNOWN AS "JOHN'S DEBUGGER" AND SOLD
THOUSANDS OF COPIES IN THE US, JAPAN AND WORLDWIDE. FOR SOME
REASON THE JAPANESE LIKED IT A LOT.
MY NEXT MAJOR PRODUCT WAS AN ASSEMBLY LANGUAGE GENERAL
LEDGER PACKAGE FOR THE APPLE II COMPUTER. I HAD WORKED WITH
HUNDREDS OF COMPUTERIZED ACCOUNTING SYSTEMS AS A CPA AND
NEVER FOUND ONE I LIKED, SO I WROTE ONE TO BE SUPER FAST
AND MARKETED IT WORLDWIDE. I THINK IT IS STILL THE FASTEST
GENERAL LEDGER AVAILIABLE FOR THE APPLE II TODAY. MY USERS
ARE VERY LOYAL AND CALL ME ALL THE TIME JUST TO CHAT.
IN 1983 I SWITCHED FROM ASSEMBLY LANGUAGE TO FORTH. ALL MY
ASSEMBLY LANGUAGE ROUTINES HAD TO BE REWRITTEN IN FORTH. FOR
THOSE OF YOU WHO DON'T KNOW, WHEN YOU WRITE IN FORTH YOU
HAVE TO RE-INVENT THE WHEEL SO TO SPEAK. SINCE THEN I HAVE
WRITTEN EIGHT SOFTWARE PRODUCTS IN FORTH FOR THE IBM PC, XT,
AND AT. ALL OF WHICH RUNS ON EVERY IBM AND COMPATIBLE. I
HAVE NOT ENCOUNTERED A COMPATIBLE COMPUTER WHICH IT DOES NOT
RUN ON.
THE IDEA FOR 'JJB' CAME TO ME LAST YEAR WHEN I DID A
COMPLETE 1040 INCOME TAX PACKAGE IN FORTH. FROM ANY LINE ON
ANY FORM, THE USER HAD TO BE ABLE TO GO DIRECTLY TO ANY LINE
ON ANY OTHER FORM, INSTANTLY. FORMS WERE AUTOMATICALLY
INITALIZED OR READ, AND UPDATED UPON EXITING.
IN 1988 I CONVERTED MY FORTH ROUTINES TO 'C'. THE
LANGUAGES ARE VERY SIMILIAR. IN DOING SO I WANTED AN
EXTREMELY HIGH-LEVEL PROGRAMMING ENVIRONMENT WITH ABSOLUTE
LOW-LEVEL CONTROL. THE RESULT IS 'JJB 1.2'. I AM CURRENTLY
WORKING ON JJB LA (LARGE APPLICATION) WHICH SHOULD BE READY
FOR RELEASE SOON.
JOHN JAMES BRODERICK
=====================================================================
*** SUMMARY OF DOCUMENTATION, INSTALLATION, and REGISTRATION ***
=====================================================================
This file and the files listed below, document JJB 1.2 explaining
what it does and how to use it. The JJBSHOW files provide you with
more information so you can begin programming with JJB. The two
header files JJBKBD.H and JJBSET.H give you even more documention.
You can print them all with the .bat file 'JJBPRINT.BAT' from DOS by
entering: 'JJBPRINT'
JJB-READ.DOC
JJBKBD.H
JJBSET.H
JJBSHOW1.C
JJBSHOW2.C
JJBSHOW3.C
JJBSHOW4.C
JJBSHOW5.C
Installing JJB is easy. Basically you just place the diskette with
the JJB files in drive a: and enter one of the four DOS commands:
JJBQC-LI (Quick C learning installation)
JJBQC-FI (Quick C final installation)
JJBTC-LI (Turbo C learning installation)
JJBTC-FI (Turbo C final installation)
All of this is explained is detail further down in this file. This
is just a summary here to show you how easy it is.
Two installation methods are provided. One is the learning
installation, the other is the final installation. Both are the
same except the final installation only moves files to the hard disk
which are necessry for programming with JJB.
Installation is designed so you do not have to create a separate
directory for JJB. Every JJB filename begins with the three letters
'JJB'. All JJB files can easily be removed from any directory with
the following DOS command: 'JJBREMOV'
-------------- JJB MANUAL (THE PRINTED DOCUMENTATION) ---------------
A manual is available and will be sent to you if you register. It is
the tenth manual I have written and sometimes I think it is harder to
write the manual then it is to write the software. If you think the
manual will be the same as this documentation, not so. Both were
written separately without referring to each other so that each
compliments and adds to the other.
Those who register will also receive the latest version of all JJB
software, the complete source code with comments for all the input
and enter functions, free technical support, and the JJB newsletter.
=========================================================================
*** JJB FILES ***
=========================================================================
JJB-READ.DOC (THIS FILE )
JJB-FORM.DOC (REGISTRATION FORM )
JJBFILES.DOC (LIST OF ALL JJB FILES )
JJBINSTL.DOC (HOW TO INSTALL JJB FOR QUICK C & TURBO C )
JJBPRINT.BAT (PRINTS ALL JJB FILES WHICH HAVE DOCUMENTATION )
JJB.EXE (A DEMO-IF YOU CAN DEMO A PROGRAMMING ENVIRONMENT )
JJBSHOW5.EXE (EXECUTABLE FILE OF SOURCE FILE 'JJBSHOW5.C' )
JJBKBD.H (HEADER FILE FOR KEYBOARD DEFINITIONS )
JJBSET.H (HEADER FILE FOR GET & SET DEFINITIONS )
JJBQC-LI.BAT (.BAT FILE FOR QUICK C LEARNING INSTALLATION )
JJBQC-FI.BAT (.BAT FILE FOR QUICK C FINAL INSTALLATION )
JJBTC-LI.BAT (.BAT FILE FOR TURBO C LEARNING INSTALLATION )
JJBTC-FI.BAT (.BAT FILE FOR TURBO C FINAL INSTALLATION )
JJBREMOV.BAT (.BAT FILE FOR REVERSE INSTALLATION REMOVING FILES )
JJBQC.OBJ (QUICK C OBJECT FILE FOR JJB INPUT & ENTER FUNCTIONS)
JJBQCINP.OBJ (QUICK C OBJECT FILE FOR JJB INPUT & ENTER FUNCTIONS)
JJBQCDOL.OBJ (QUICK C OBJECT FILE FOR JJB INPUT DOLLAR FUNCTIONS )
JJB.QLB (QUICK C JJB LIBRARY CREATED WHEN INSTALLED )
JJBTC.OBJ (TURBO C OBJECT FILE FOR JJB )
JJBTCINP.OBJ (TURBO C OBJECT FILE FOR JJB INPUT & ENTER FUNCTIONS)
JJBTCDOL.OBJ (TURBO C OBJECT FILE FOR JJB INPUT DOLLAR FUNCTIONS )
JJBSHOW1.C (TURBO C AND QUICK C SAMPLE PROGRAM )
JJBSHOW2.C (TURBO C AND QUICK C SAMPLE PROGRAM )
JJBSHOW3.C (TURBO C AND QUICK C SAMPLE PROGRAM )
JJBSHOW4.C (TURBO C AND QUICK C SAMPLE PROGRAM )
JJBSHOW5.C (TURBO C AND QUICK C SAMPLE PROGRAM )
JJBQCS1.BAT (QUICK C .BAT FILE TO LOAD JJBSHOW1 WITH JJB.QLB )
JJBQCS2.BAT (QUICK C .BAT FILE TO LOAD JJBSHOW2 WITH JJB.QLB )
JJBQCS3.BAT (QUICK C .BAT FILE TO LOAD JJBSHOW3 WITH JJB.QLB )
JJBQCS4.BAT (QUICK C .BAT FILE TO LOAD JJBSHOW4 WITH JJB.QLB )
JJBQCS5.BAT (QUICK C .BAT FILE TO LOAD JJBSHOW5 WITH JJB.QLB )
JJB-READ.DOC
The main documentation file for JJB.
JJB-FORM.DOC
This is the JJB registration form file. From DOS, you can
print it by entering: TYPE JJB-FORM.DOC > PRN:
JJBFILES.BAT
A list of all JJB files.
JJBINSTL.BAT
Explains how to install JJB. It is included in JJB-READ.DOC
JJBPRINT.BAT
Use this bat file to print all JJB files which have
documentation.
JJB.EXE
JJBSHOW5.EXE
These are demo files. It is hard to demo a programming
environment and it probably should not be done; but I wanted
to include something to show you what JJB can do. The source
for JJBSHOW5.EXE is in file JJBSHOW5.C. Both of these were
compiled with Quick C. If compiled with Turbo C they would
run a lot faster.
JJBKBD.H
JJBSET.H
In every program you write with JJB, you should include
these two files as shown below:
#include <jjbkbd.h>
#include <jjbset.h>
The JJB installation .bat files will move them to the
\include directory for you when you do a learning or final
installation.
JJBQC-LI.BAT
This file installs the learning installation for Quick C
programmers. See the section in this file entitled 'QUICK C
LEARNING INSTALLATION'.
JJBQC-FI.BAT
This file installs the learning installation for Quick C
programmers. See the section in this file entitled 'QUICK C
FINAL INSTALLATION'.
JJBTC-LI.BAT
This file installs the learning installation for Turbo C
programmers. See the section in this file entitled 'TURBO C
LEARNING INSTALLATION'.
JJBTC-FI.BAT
This file installs the learning installation for Turbo C
programmers. See the section in this file entitled 'TURBO C
FINAL INSTALLATION'.
JJBREMOV.BAT
Use this .bat file to remove all JJB files from drive c: and
do a reverse installation.
JJBQC.OBJ
This is the main JJB 1.2 object file. The code is very tight
and it was compiled with Quick C using only two include
files: 'dos.h' and 'setjmp.h'.
The same source file was used for both Quick C and Turbo C,
however they were compiled separately to ensure that you do
not have any problems with compatibility.
JJBTC.OBJ
This is the main JJB 1.2 object file. The code is very tight
and it was compiled with Turbo C using only two include
files: 'dos.h' and 'setjmp.h'.
The same source file was used for both Quick C and Turbo C,
however they were compiled separately to ensure that you do
not have any problems with compatibility.
JJBQCINP.OBJ
JJBTCINP.OBJ
These are the object files for the JJB 'input(' and 'enter('
functions.
The same source file was used for both Quick C and Turbo C,
however they were compiled separately to ensure that you do
not have problems of compatibility.
You will receive the complete source code along with
comments when you register with JJB.
JJBQCDOL.OBJ
JJBTCDOL.OBJ
These are the object files the JJB 'input_dollar(' and
'enter_dollar(' functions.
The same source file was used for both Quick C and Turbo C,
however they were compiled separately to ensure that you do
not have problems of compatibility.
You will receive the complete source code along with
comments when you register with JJB.
JJBSHOW1.C
JJBSHOW2.C
JJBSHOW3.C
JJBSHOW4.C
JJBSHOW5.C
These are sample source files for both Turbo C and Quick C.
In Turbo C you can just load them like any other source file
after you install JJB. In Quick C, you should include the
JJB Quick Library file JJB.QLB (qc /l JJB.QLB jjbshow.c)
when loading or you can use the .bat files below designed
only for Quick C loading of JJBSHOW files.
JJBQCS1.BAT
JJBQCS2.BAT
JJBQCS3.BAT
JJBQCS4.BAT
JJBQCS5.BAT
To load the source file JJBSHOW1.C in Quick C, enter the
following from DOS: JJBQCS1. Do the same for the other show
files.
QUICK C
======================================================================
*** JJB LEARNING INSTALLATION FOR QUICK C PROGRAMMERS ***
======================================================================
Place the floppy diskette in drive a: and enter: JJBQC-LI
It will:
1. Move all files to the hard disk drive c:
jjbkey.h and jjbset.h to c:\include
All the rest to c:\bin
2. Creates the JJB quick library JJB.QLB
and load the first show file with JJBQCS1.
You may have noticed that JJB tried to delete two files
which it could not find on the disk drive. That is the way
it should work because Quick C does not like to make a quick
library if the file already exists on the disk drive.
You should now be in Quick C looking at the sample file
JJBSHOW1.C. If you now press 'F5', the file should compile
and execute.
If you need to exit Quick C, press 'ALT,' 'RETURN', 'X'.
To re-enter the source file, from DOS enter 'JJBQCS1'.
To compile and execute 'JJBSHOW1.C' from DOS enter:
C:\BIN>JJBQCS1, then press 'F5'.
You can load any of the five source examples with the
following commands from DOS:
JJBQCS1
JJBQCS2
JJBQCS3
JJBQCS4
JJBQCS5
To remove all JJB files from drive c: enter: 'JJBREMOV'
This deletes all the JJB files from drive c: doing a reverse
installation.
QUICK C
======================================================================
*** JJB FINAL INSTALLATION FOR QUICK C PROGRAMMERS ***
======================================================================
The purpose of this installation is to install only the JJB
files which are necessary for Quick C programming.
The files are: JJBKBD.H
JJBSET.H
JJBQC.OBJ
JJBQCINP.OBJ
JJBQCDOL.OBJ
Place the JJB diskette in drive a: and enter: 'JJBQC-FI'
Don't forget to delete all JJB files from your hard disk
before you make the final installation. The entire purpose
of the final installation is to clean up your hard disk. So
please remove the files as shown in the learning
installation.
TURBO C
======================================================================
*** JJB LEARNING INSTALLATION FOR TURBO C PROGRAMMERS ***
======================================================================
Place the floppy diskette in drive a: and enter: JJBTC-LI
It will:
1. Move all files to the hard disk drive c:
jjbkey.h and jjbset.h to c:\tc\include
All the rest to c:\tc
2. Add the object modules to the small library
and load the first show file JJBSHOW1.C
You should now be in Turbo C and can execute the show file
by pressing CTRL F9.
To remove all JJB files from drive c: enter: 'JJBREMOV'
This deletes all the JJB files from drive c: doing a reverse
installation.
TURBO C
======================================================================
*** JJB FINAL INSTALLATION FOR TURBO C PROGRAMMERS ***
======================================================================
The purpose of this installation is to install only the JJB
files which are necessary for Quick C programming.
The files are: JJBKBD.H
JJBSET.H
JJBTC.OBJ
JJBTCINP.OBJ
JJBTCDOL.OBJ
Place the JJB diskette in drive a: and enter: 'JJBTC-FI'
Don't forget to delete all JJB files from your hard disk
before you make the final installation. The entire purpose
of the final installation is to clean up your hard disk. So
please remove the files as shown in the learning
installation.
=====================================================================
*** LIST OF JJB FUNCTIONS ***
=====================================================================
FUNCTIONS TO USE IN main():
jjb_initalize() initalizes JJB
jjb_setup() set up your program groups and options
jjb_start() start executing your program functions
FUNCTIONS TO USE IN jjb_setup():
group("string") begin setting up a group of options
option("string F4") assign description & funct. key to option
funct(functionname) assign a function name to an option
default_opt() uses last option set up for default option
init(functionname) assign for initalizing group or option
leave(functionname) assign for exiting group or option
help(functionname) assign a function name to help
dosexit(functionname) execute this function when exiting to DOS
KEYBOARD FUNCTIONS (low to high level):
clrkeys() clear keyboard
read_kcode() read keyboard scan code
kbint() the keyboard interrupt JJB uses
keyp(type) read keyboard according to type
keypress(type) reads from string or from keyboard
get_c(type) handles 'Was ALT pressed?'
get_ch() the high-level 'getch()' to use
get_num() do not allow alpha keypresses
get_any() return if user pressed a key
store_keys("string") store string for keyboard to read
VIDEO FAST 'VF' FUNCTIONS:
bright() make color bright
getvoff() return video offset 0-1999
normal() change color setting to the normal color
reverse() change color setting to the reverse color
setvoff(voffset) set video offset to number 0-1999
set_color(WHITE ONBLUE) high-level set color function to use
underline() change color setting to the underline color
va(RED ONBLACK) set video attribute to any color on any color
vbl() return 'vf' offset for beginning of row
vbout(ch) display byte in bits 1111 1111
vch(ch,voffset) put char on video at video offset 0-1999
vclr_screen() clear entire screen
vclreol() clear to end of line
vclrft(fromrow,torow) clear screen from one row to row
vclrw() clear main window depending on VCLRW_SW
vcr() do one 'vf' carriage return
vcrs(x) do x number of 'vf' carriage returns
vfc(ch) put out 'vf' character at video offset
vfcc(ch) same as above except place actual cursor after
vfi(x) 'vf' an integer at the video offset
vfir(x,length) 'vf' integer right justified in field
vfs("string") 'vf' string at video offset
vfsc("cursor after") same as above except put cursor after
vfsdo("string",down,over) string out & set 'vf' cursor down & over
vfsl("str out left",fld) 'vf' string left justified in field
vftout(char,x) 'vf' char x times out
vfw(r,c,d,w) makes a super fast window
vgrid() programmer's grid ^G from any keypress
vinit_screen() initalize direct memory video access
vloc(row,column) set video offset for all 'vf'
vr(x) return screen char with attribute at x video offset
vrc(voffset) video restore character from JJB save buffer
vrest_scr(&array[0]) restore screen from your int array
vrest_screen() restore screen from JJB array
vsave_scr(&array[0]) save screen in your int array
vsave_screen() save screen in JJB int array
vspace() video fast one space
vspaces(x) video fast x spaces
OTHER FUNCTIONS:
between(x,from,to) return true if x is = or betw. from/to
cf() copyright function initalizing all options
dspopt() displays option for pull-down window
getcoff() return cursor position as num 0-1999
gop() get no. of current option executing.
sop() sets option to execute at next keypress
jdelay(x) the JJB delay routine
jsel() displays top selection row
jbot() displays bottom selection row
len("string") returns length of string
loc(row,column) locates actual cursor for printf(
nbetween(x,from,to) return true if x is not = or betw. from/to
nf() null function for initalizing & exiting
pak() returns address of global "Press any key "
set(UPPER_SW,T) example of setting a switch, see JJBSET.H
setc(KEY,'A') example of setting char in char array
setcoff(offset) set cursor as number from 0-1999
strcopy("asdf",str_ptr) just a string copy function
=====================================================================
*** JJB GLOSSARY OF FUNCTIONS ***
=====================================================================
---------------------------------------------------------------------
int between(x,from,to) between(
---------------------------------------------------------------------
int x; integer testing
int from; from range
int to; to range
This function returns a true if integer x is equal to or falls
between the from/to range.
Example: if ( between(x,1,12) ) dosomething();
---------------------------------------------------------------------
void bright(void) bright(
---------------------------------------------------------------------
The bright() function turns on the bright bit for for 'vf' functions.
Example:
bright();
vfs("This will be brighter. ");
normal();
vfs("This will appear in the normal color.");
The bright() function turns on the bright bit for the video attribute
currently being used. It handles for both monochrome and color
monitors. To turn it off use the normal() function or any other
function which changes the video attribute.
---------------------------------------------------------------------
void cf(void) cf(
---------------------------------------------------------------------
The 'cf()' function is used by jjb_initalize() to initalize each
option with a null copyright function. In jjb_setup() you can set up
options without assigning functions to them. The options that are not
assigned will execute this function.
---------------------------------------------------------------------
void clrkeys(void) clrkeys(
---------------------------------------------------------------------
This function clears the eight variables which were sent when the
last key was read from the keyboard. The variables are KE, KEU, KEE,
KCODE, IKE, IKEU, IKEE, IKCODE as explained in file: JJBKBD.H.
---------------------------------------------------------------------
void default_opt(void) default_opt(
---------------------------------------------------------------------
This function allows you to assign any option as the default option.
Place it after the 'option(' function in jjb_setup(). If you assign
more than one option as the default option, JJB will only use the
last one assigned.
It is nice to to be able to immediately start testing the function
you are programming. As you are writing your program, place this
function after the option you want to test. Execution will start with
the option.
Use this function only in jjb_setup(). For examples see source files
JJBSHOW1.C through JJBSHOW5.C.
---------------------------------------------------------------------
void dosexi(void) dosexi(
---------------------------------------------------------------------
This is the function JJB executes when you press ALT X to exit your
program. You can disable it in jjb_setup() by setting the following
switch to true as such: set(ALTXOFF_SW,T);
Once disabled, ALT X will not exit your program.
Most program ask a question before exiting. You can activate the
question by setting this switch in jjb_setup(): set(ALTXSURE_SW,T);
Pressing ALT X should then show the following question in the bottom
left-hand corner of the screen:
'DOS exit. Are you sure Y/N ?'
Press 'Y' for yes to exit and 'N' for no, do not exit but return to
the function you were executing.
---------------------------------------------------------------------
void dosexit(*funcptr) dosexit(
---------------------------------------------------------------------
If you have a function you want executed when leaving the program use
this function to assign it in jjb_setup(). Here is an example:
my_exit() {
any code here
}
jjb_setup() {
dosexit(my_exit);
}
---------------------------------------------------------------------
void funct(*funcptr) funct(
---------------------------------------------------------------------
Every option you set up in jjb_setup() should eventually be assigned
a function. Use 'funct(' to assign.
All options are initalized by jjb_initalize() with the null function
'vff()' displaying the JJB copyright notice.
Use this function only in jjb_setup(). For examples see source files
JJBSHOW1.C through JJBSHOW5.C.
---------------------------------------------------------------------
int getcoff(void) getcoff(
---------------------------------------------------------------------
'getcoff' is short for GET CURSOR OFFSET. The offset returned
will be an integer from 0 to 1999. This is a very useful function
when you want to save the cursor position and then reset it later.
Here is an example of saving and resetting the cursor position:
int save_cursor;
1 save_cusror = getcoff(); /* save physical cursor */
` any code here
setcoff(save_cursor); /* reset physical cursor */
In JJB there is an actual cursor seen on the screen and an invisible
'vf' cursor for all the video fast functions. This function affects
only the actual phyicsal cursor.
---------------------------------------------------------------------
int getvoff(void) getvoff(
---------------------------------------------------------------------
This function returns the video offset position used by the JJB
functions. The number returned will be a number from 0-1999.
Here is an example of saving and resetting the video offset:
int voffset;
voffset = getvoff(); /* save invisible 'vf' cursor */
place any code here
setvoff(voffset); /* restire 'vf' invisible cursor */
---------------------------------------------------------------------
unsigned char get_c(type) get_c(
---------------------------------------------------------------------
This is a low-level keyboard function used JJB routines. It is
explained in the complete printed documentation.
---------------------------------------------------------------------
unsigned char get_any(void) get_any(
---------------------------------------------------------------------
This function waits for you to press down on any key on the keyboard.
It is unlike 'get_ch()' which will not return if you only press the
capital locks or shift keys.
Example:
char ch;
ch = get_any();
if (RIGHTSHIFT_PRESSED) do_something();
Once more thing. JJB is designed so that you do not have to worry
about the character you just fetched from the keyboard. In the above
example, you could use 'get_any();' instead of 'ch = get_any();'.
---------------------------------------------------------------------
unsigned char get_ch(void) get_ch(
---------------------------------------------------------------------
This is the main keyboard function you should use in your programs.
Do not use getch() unless you want to bypass the JJB environment.
The 'get_ch()' function is a very high-level function. It can read
internally stored strings which you have defined with 'store_keys('.
It can handle changing of options. In fact, it uses five lower-level
functions in the following order: get_c(, keypress(, keyp(,
kbint(, and read_kcode(.
---------------------------------------------------------------------
unsigned char get_num(void) get_num(
---------------------------------------------------------------------
This function is the same as 'get_ch()' except it will not accept
alpha-numeric keypresses.
---------------------------------------------------------------------
unsigned int get(int) get(
---------------------------------------------------------------------
This function returns the value of an integer which has been stored
in the integer array.
Instead of having 50 to 100 separate integers. JJB uses only one
array which can easily be set or accessed from any object module. See
header file jjbset.h for a list of all the elements in the array. The
complete printed documentataion explains each element in the array.
---------------------------------------------------------------------
unsigned char getc(int) getc(
---------------------------------------------------------------------
This function is the same as 'get(' except it gets a character
from the JJB character array. Many examples are show in file jjbset.h
---------------------------------------------------------------------
int gop(void) gop(
---------------------------------------------------------------------
This function returns the current option number. Every option in
your program is assigned a number starting with 1. If you have 50
options, then this function can return a number up to 50. See the
help( function for examples.
---------------------------------------------------------------------
void gname_out(void) gname_out(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void group(char *string) group(
---------------------------------------------------------------------
This function defines a group by assigning it a character
description. It also starts the assignment of options to the group.
See the show files for many examples.
---------------------------------------------------------------------
void group_heading(void) group_heading(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void help(*funcptr) help(
---------------------------------------------------------------------
You can assign a help function which can be called in your program by
pressing the F1 key. Here in an example:
my_help() {
if (gop() == 1) { do help for option 1 }
if (gop() == 2) { do help for option 2 }
if (gop() == 3) { do help for option 3 }
if (gop() == 4) { do help for option 4 }
if (gop() == 5) { do help for option 5 }
}
jjb_setup() {
help(my_help);
}
---------------------------------------------------------------------
void init(*functpr) init(
---------------------------------------------------------------------
Every group and option may be initialized with a function. There are
many examples in the show files.
---------------------------------------------------------------------
void jbot(void) jbot(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void jdelay(int) jdelay(
---------------------------------------------------------------------
This is the JJB delay function. It does two loops, one inside
the another. The number sent it must be from 1 to 255. If not, JJB
will correct it.
jdelay(1) does no delay.
jdelay(2) loops 4 times (2 x 2)
jdelay(5) loops 25 times (5 x 5)
jdelay(100) loops 10,000 times (100 x 100)
jdelay(255) loops 65,250 times (255 x 255)
It is a simple little delay routine which does not take much thought
to operate. Once you set the delay, it can continue with the same
delay as follows:
delay(80);
delay(SAME);
delay(SAME);
delay(SAME);
One more thing. JJB has the ability to read keys from a stored
string. If not slowed down, they will appear on the screen as if
they are being typed in. In order to slow them down every 'get_ch()'
executes a delay depending on the value KBDDEL.
The fastest setting is set(KBDDEL,1);
The slowest setting is set(KBDDEL,255);
Try this code and see what happens:
store_keys("My name is John.!");
set(KBDDEL,88);
input(30);
The function 'input(30)' reads a string up to 30 characters in length
returning the address. In the above example we don't need the address
so it was ignored. The'!' character stands for the 'RETURN' key
telling the input function that return has been pressed. The source
code for all input and enter functions is available only for
registered users.
---------------------------------------------------------------------
void jjb_initalize(void) jjb_initalize(
---------------------------------------------------------------------
This function initalizes JJB direct memory access address, the arrays
and pointer, sets up the default color settings for the video mode in
use, plus many other things.
See the main() function in this glossary and the show files for more
explanation.
---------------------------------------------------------------------
void jjb_setup(void) jjb_setup(
---------------------------------------------------------------------
Use this function to set up groups of options which JJB will execute
when it executes the function jjb_start().
For examples, see source files JJBSHOW1.C through JJBSHOW5.C.
---------------------------------------------------------------------
void jjb_start(void) jjb_start(
---------------------------------------------------------------------
This function is a processing loop which executes your program
functions. Whenever you select a new option, JJB does a long jump
back to this loop executing the leave functions for the option and
group, then it initalizes the new group and option and finally
calls the option function.
This loop will be continued until you press ALT X to exit your
program. If you are testing your program you can press CONTROL C or
CONTROL PAUSE to force an abort returning to QUICK C or TURBO C.
Further down in this file is a box which outlines the processing loop
that that function begins executing.
---------------------------------------------------------------------
void jsel(void) jsel(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void kbint(void) kbint(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void keyp(int type) keyp(
---------------------------------------------------------------------
This is a low-level function used JJB routines. It is explained in
detail in the complete printed documentation.
---------------------------------------------------------------------
void keypress(int type) keypress(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void leave(*funcptr) leave(
---------------------------------------------------------------------
Every group and/or option can be exited with a function. There are
many examples of this in the show files.
---------------------------------------------------------------------
loc(int row, int col) loc(
---------------------------------------------------------------------
Use this function to locate the physical cursor on the video monitor.
'loc(1,1);' places the cursor in the top left-hard corner of the
screen. 'loc(25,80);' places the cursor in the bottom right-and
corner.
You can also use the function 'setcoff(' to position the physical
cursor as in the following examples:
setcoff(0) is the same as loc(1,1)
setcoff(1999) is the same as loc(25,80)
---------------------------------------------------------------------
void main(void) main(
---------------------------------------------------------------------
This is the main function in your program. Every program you write
using JJB should have a main function which looks like this:
main() {
jjb_initalize(); /* initalize JJB system */
jjb_setup(); /* set up your program options */
jjb_start(); /* start executing your program functions*/
}
You do not have to use all of the features of JJB. If you just want
to use some of the JJB functions, initalize JJB by making it your
first instruction in main. After initalization, you can use almost
all of the functions explained in this glossary.
main() {
jjb_initalize();
place your program code here
}
---------------------------------------------------------------------
int nbetween(x, from, to) nbetween(
---------------------------------------------------------------------
int x; integer testing
int from; from range
int to; to range
This function returns a true condition if integer x is not equal to
or fall between the from/to range.
Example: if ( nbetween(x,1,12) ) dosomething();
---------------------------------------------------------------------
void nf(void) nf(
---------------------------------------------------------------------
Each group and option can be initalized and exited with a function
you can assign in jjb_setup(). If you do not assign one, JJB will
execute this null function which does nothing.
---------------------------------------------------------------------
void normal(void) normal(
---------------------------------------------------------------------
Use 'normal()' in your program when you want to change the attribute
to the normal color. This function properly handles both color and
monochrome monitors.
This function resets the video fast 'vf' color attribute to the
normal color attribute. On monochrome it is white on black (7).
The normal color attribute is set in jjb_initalize() as followed:
set(VNCOLOR, WHITE ONBLUE). It can be changed in jjb_setup() to any
color on any color as follows: set(VNCOLOR, BLACK ONBLUE);
The JJB manual devotes an entire chapter on how easy it is to select
a color setting.
---------------------------------------------------------------------
void option(char *,DRAWLINE) option(
---------------------------------------------------------------------
The option function starts defining a new option by assigning it a
string of characters.
examples:
jjb_setup() {
option("Copy File")
option("Read 'F'ile",DRAWLINE);
option("Write File F8")
}
In the first example above, we did not specify which letter to use
for selection so JJB will use the first letter. If the first letter
was used by a previous option, then JJB will use the second letter
and so on.
In the second example we specified 'F' to be the selection letter.
You can assign to any option the function keys F2 thru F9 by just
placing it in the description at the end. Notice that the ',DRAWLINE'
is optional and should be used only when you what to separate this
option from the next one.
After 'option(' you can use 'funct(', 'init(', 'leave(',
default_opt(' in any order.
---------------------------------------------------------------------
char *pak(void) pak(
---------------------------------------------------------------------
The 'pak()' function returns the global address of "Press any key ".
The following will video it on the screen and wait for a keypress:
vfs( pak() );
get_ch();
It is the same as: char ch;
printf("Press any key ");
ch = getch();
---------------------------------------------------------------------
void read_kcode(void) read_kcode(
---------------------------------------------------------------------
This is a low-level function used by the JJB routines. It is
explained in detail in the complete printed documentation.
---------------------------------------------------------------------
void reverse(void) reverse(
---------------------------------------------------------------------
Use 'reverse()' in your program when you want to change the attribute
to the reverse color. This function properly handles both color and
monochrome monitors.
This function resets the video fast 'vf' color attribute to the
reverse color attribute. On monochrome it is black on white (112).
The reverse color attribute is set in jjb_initalize() as followed:
set(VRCOLOR, BLUE ONWHITE). It can be changed in jjb_setup() to any
color on any color as follows: set(VRCOLOR, RED ONWHITE);
---------------------------------------------------------------------
void set(int offset, int value) set(
---------------------------------------------------------------------
This function sets the value of an integer which has been stored in
the JJB integer array. Instead of having 50 to 100 separate integers
to handle JJB, it uses only one integer array which can easily be set
or accessed from any object module.
See jjbset.h file for a list of the elements in the array. The
complete printed documentataion explains each element in the array
and what it does.
---------------------------------------------------------------------
void set_color(unsigned int color) set_color(
---------------------------------------------------------------------
This is a high-level function which allows you to change the color
setting.
Examples: set_color(BLACK ONRED);
set_color(BLUE ONWHITE);
You can set the color to any color on any color. When your program
runs, if the user of your program has a monochrome, then the change
will not be made.
---------------------------------------------------------------------
void setcoff(int) setcoff(
---------------------------------------------------------------------
'setcoff' is short for SET CURSOR OFFSET. Use this function to
set the physical cursor anywhere on the screen. It does the same
as the 'loc(' function except it uses only one integer amount for the
offset instead of a row and a column.
The number you send it must be between 0 and 1999.
setcoff(82) will place the cursor on row 2, column 3.
Here is an example of saving and resetting the cursor position:
int save_cursor;
save_cusror = getcoff();
` any code here
setcoff(save_cursor);
---------------------------------------------------------------------
void setvoff(int) setvoff(
---------------------------------------------------------------------
This function sets the video fast 'vf' invisible video offset cursor.
It should always be a number from 0 to 1999.
Here is an example of saving and resetting the video offset:
int voffset;
voffset = getvoff(); /* save video offset */
any code here
setvoff(voffset); /* reset video offset */
The video offset can also be set with the 'vloc(' function. Both do
the same thing except 'setvoff(' does it with only one integer and is
much faster because there is no calculation to make.
---------------------------------------------------------------------
void store_key(char *pointer) store_keys(
---------------------------------------------------------------------
The 'store_keys(' function allows you to internally store a string of
characters to be read as keypresses with the get_ch(), input( and
enter( functions.
Example: store_keys("Your program typed this in.!");
Once you have stored the characters using this function, nothing will
happen until execution comes to the next get_ch(), get_num(),
get_any(), or any of the input or enter functions.
When that happens, the actual keyboard will not be read. Instead the
character will be fetched from the string. You can adjust the speed
at which characters are read by setting the KBDDEL variable as
follows: 'set(KBDDEL,88);'. The get_ch() function does a delay with
every read just for the purpose of slowing down internally stored
strings. KBDDEL is usually set to '1' so there is no delay unless you
reset it.
You can place special characters in the string which have the
following meaning:
'%' is ALT
'!' is RETURN
'@' is ESC
'<' is LEFT ARROW
'>' is RIGHT ARROW
'^' is UP ARROW
'~' is DOWN ARROW
The JJB demo does a 'store_keys("%!>>>>>>>>>@");' to show you some
fast windowing.
---------------------------------------------------------------------
void strcopy(char *pointer, char *pointer) strcopy(
---------------------------------------------------------------------
This function does a simple string copy. An example is:
char string[30];
char *sp;
sp = &string[0];
strcopy("Copy this", &string[0];
strcopy("Copy this",sp);
---------------------------------------------------------------------
void va(unsigned int color) va(
---------------------------------------------------------------------
This is the lowest-level function for setting the color. Here is an
example:
va(RED ONBLACK);
It does not take into consideration monochrome like the 'set_color('
function does. Use it only when you know the monitor your program
will be displayed on. It does 'exactly' the same thing as:
set(VATTRIB, RED ONBLACK)G.
---------------------------------------------------------------------
int vbl(void) vbl(
---------------------------------------------------------------------
This function returns the video fast 'vf' invisible offset for the
beginning of the row you are on. It will be an integer from 0-1999.
Example: int beg_line;
beg_line = vbl();
---------------------------------------------------------------------
void vfbout(char) vbout(
---------------------------------------------------------------------
This does a video fast 'vf' of the bits of one byte.
vfbout(9); puts out: 0000 1001
---------------------------------------------------------------------
void vch(char ch, int voffset) vch(
---------------------------------------------------------------------
This is a low-level video fast 'vf' function which puts on the screen
one character at the invisible offset position: Here is an example:
char ch;
ch = 'A';
for (x=70; x<=159; x++) {
vch(ch, x);
}
The above will put 80 characters on the screen. Ten characters will
appear on row one, and 70 characters will appear on row two.
---------------------------------------------------------------------
void vclr_screen(void) vclr_screen(
---------------------------------------------------------------------
This is a video fast 'vf' function which clears the screen and places
the 'vf' invisible cursor in the home position.
---------------------------------------------------------------------
void vclreol(void) vclreol(
---------------------------------------------------------------------
This function will clear to end of a line starting at the video fast
'vf' offset position. It clears to the end of the row from the
present invisible 'vf' cursor.
---------------------------------------------------------------------
void vclrft(int from, int to) vclrft(
---------------------------------------------------------------------
This function clears the screen from one row to another.
Example: vclrft(2,24);
The above example clears rows 2 through 24, leaving row 1 and row 25
on the screen.
---------------------------------------------------------------------
void vclrw(void) vclrw(
---------------------------------------------------------------------
This function clears the main JJB window. If you do not want a window
to appear, set the following switch in jjb_setup(): set(VCLRW_SW,T).
Once set, vclrw() function will clear rows 2 through 24 not making a
window.
---------------------------------------------------------------------
void vcr(void) vcr(
---------------------------------------------------------------------
This function videos fast 'vf' a carriage return. It is the
'vf' equivalent of 'printf("\n");'.
---------------------------------------------------------------------
void vcrs(int x) vcrs(
---------------------------------------------------------------------
This videos fast 'vf' x number of carriage returns.
---------------------------------------------------------------------
void vf_window(row,column,depth,width) vf_window(
---------------------------------------------------------------------
This function videos fast 'vf' a window at integer row, column,
depth, and width.
Example: vf_window(8,20,10,50);
You can use the set_color(COLOR ONCOLOR) before using this function
to make any color window you choose.
---------------------------------------------------------------------
void vfc(char) vfc(
---------------------------------------------------------------------
Use this function to video fast 'vf' a character on the screen. Here
is an example:
char ch;
ch = get_ch();
vfc(ch);
---------------------------------------------------------------------
void vfcc(char) vfcc(
---------------------------------------------------------------------
Use this function to video fast a character on the screen placing
the physical cursor after it. Here is an example:
char ch;
ch = get_ch();
vfcc(ch);
If you have the source code for the JJB input routines then you can
see that this function was used to display each character as it was
typed in.
---------------------------------------------------------------------
void vfi(int number) vfi(
---------------------------------------------------------------------
This function videos fast 'vf' an integer on the screen.
Examples:
vfi(1200);
vfi(x);
---------------------------------------------------------------------
void vfir(int number, int fieldlength) vfir(
---------------------------------------------------------------------
Use this function to video fast 'vf' an integer in a field,
right-justified.
Examples:
vfir(x,5);
vfir(123,5);
This might be on another subject, but one nice thing about the input
routines is that in addition to editing the numbers input, they also
return the number right-justified in a field ready to be displayed on
the monitor. In that case you do not need to use this function.
---------------------------------------------------------------------
void vfs(char *pointer) vfs(
---------------------------------------------------------------------
This function videos fast 'vf' a string at the invisible cursor
position.
Examples:
char string[40];
char *sp;
sp = &string[0];
vfs("Put out this string.");
vfs(sp);
vfs(&string[0]);
---------------------------------------------------------------------
void vfsc(char *pointer) vfsc(
---------------------------------------------------------------------
This function is the same as 'vfs(' except it puts the physical
cursor on the screen after putting out the string.
Normally, the 'vf' function advances the video offset so your strings
and integers are not all placed in the same location. They do not
normally place the physical cursor because then they would not be
fast. This function videos fast the string and then places the actual
physical cursor at the end.
---------------------------------------------------------------------
void vfsdo(char *ptr,int down,int over) vfsdo(
---------------------------------------------------------------------
The 'vfsdo(' function, videos fast 'vf' a string of chararacter and
then comes down and over on the screen. Once set, you may use ',SAME'
to duplicate the previous functions.
vloc(6,20);
vfsdo("Put this on screen.',2,20);
vfsdo("This appears on row 8 starting at column 20",SAME);
vfsdo("This appears on row 10 starting at column 20",1,20);
vfsdo("This appears on row 11 starting at column 20",SAME);
vfs("Press any key ");
get_ch();
---------------------------------------------------------------------
void vfsl( char *pointer, int fieldlength) vfsl(
---------------------------------------------------------------------
This function videos fast 'vf' a string left justifing it in a field.
It is a very useful function when you do not know how many characters
will be put out.
Example: vfsl("Put 6 blanks after this.",30);
The above string is only 24 characters in length. The required field
length is 30, so 6 blanks will be put out after the string.
---------------------------------------------------------------------
void vftout(char,int x) vftout(
---------------------------------------------------------------------
'vftout(' stands for video fast times out. It does a super fast
character out x number of times.
Example:
vloc(10,1); /* locate 'vf' at row 10 column 1 */
vftout('-',80); /* put out 80 hyphens */
The above example places a line on the screen at row 10 at
extremely high speed.
---------------------------------------------------------------------
void vfw(row,col,width,depth) vfw(
---------------------------------------------------------------------
The 'vfw(' function makes a video fast 'vf' window on the screen.
Example: set_color(RED ONBLUE);
vfw(8,16,50,10);
normal();
The above example makes a window with a blue background at row 8,
column 16, width of 50, and depth of 10 rows. The color attribute was
then set back to the normal color.
---------------------------------------------------------------------
void vgrid(void) vgrid(
---------------------------------------------------------------------
This function places a border around the screen. You can use it to
help determine rows and columns. JJB is designed so that if you
press CONTROL G whenever your program is expecting a keypress, JJB
will place this programmer's grid on the screen.
---------------------------------------------------------------------
void vloc(int row, int column) vloc(
---------------------------------------------------------------------
This function sets the video fast 'vf' invisible cursor. Row must be
an integer from 1 to 25. Column must be an integer from 1 to 80.
You can access this value with the 'getvoff()' function as a
number from 0 to 1999. The 'setvoff(' function is the same as 'vloc('
except it requires only one number 0-1999 to set the 'vf' invisible
cursor.
'vloc(1,1)' sets the 'vf' offset to the top left hand corner.
'vloc(25,80)' set the 'vf' offset to the bottom right hand corner.
'vloc(1,1) is exactly the same as setvoff(0).
---------------------------------------------------------------------
char vr(int voffset) vr(
---------------------------------------------------------------------
This function reads a character with color attribute from the video
monitor returning it to you.
---------------------------------------------------------------------
unsigned char vrc(int voffset) vrc(
---------------------------------------------------------------------
This function reads one character from the JJB save screen array, and
places it on the screen with its attribute.
The function 'vsave_screen()' stores the entire screen in the array.
With the 'vrc(' function you can fetch a character from the array and
place it back on the screen. This function was used in the JJB demo
to slide the window across the screen very smoothly.
---------------------------------------------------------------------
void vrest_scr(int array address) vrest_scr(
---------------------------------------------------------------------
This function restores a screen from an array. See the 'vsave_scr('
function for examples.
---------------------------------------------------------------------
void vrest_screen() vrest_screen(
---------------------------------------------------------------------
This function restores the screen from the JJB integer array. Use it
after the vsave_screen() function to restore the screen.
---------------------------------------------------------------------
void vsave_scr(int array address) vsave_scr(
---------------------------------------------------------------------
This function allows you to save a screen. It can be used to save as
many screens as you need. Below is an example of how to use it to
simultaneously save and restore two screens.
any_function() {
int screen1[2000]; /* integer array for a screen */
int screen2[2000]; /* integer array for a screen */
vsave_scr(&screen1[0]; /* save screen 1 */
clr_screen(); /* clear the screen */
vloc(1,1); /* home the 'vf' cursor */
vfs("First message"); /* put text on screen */
vsave_scr(&screen1[0]); /* save screen 1 */
vloc(1,1); /* home the 'vf' cursor */
vfs("Second message"); /* put text on screen */
vsave_scr(&screen1[0]); /* save screen 2 */
vrest_scr(&screen1[0]; /* restore screen 1 */
get_ch(); /* stop to pause */
vrest_scr(&screen2[0]; /* restore screen 2 */
}
There is no limit to the number of screens you can save and restore
with this function.
---------------------------------------------------------------------
void vsave_screen(void) vsave_screen(
---------------------------------------------------------------------
This function saves the screen in the JJB integer array. It is used
by JJB to save the screen before doing the pull-down menus. The
screen can be restored with 'vrest_screen();'.
---------------------------------------------------------------------
void vspace(void) vspace(
---------------------------------------------------------------------
This function is the video fast 'vf' equivalent of printf(" ").
---------------------------------------------------------------------
void vspaces(int x) vspaces(
---------------------------------------------------------------------
This function videos fast 'vf' x number of spaces on the screen.
---------------------------------------------------------------------
void underline(void) underline(
---------------------------------------------------------------------
Use 'underline()' in your program when you want to change the
color attribute to the underline color. This function properly
handles both color and monochrome displays.
This function resets the 'vf' color attribute to the underline color
attribute. On monochrome it is '_' (1).
The reverse color attribute is set in jjb_initalize() as followed:
set(VRCOLOR, BLUE ONWHITE). It can be changed in jjb_setup() as
in this example: set(VRCOLOR, RED ONWHITE);
---------------------------------------------------------------------
char upcase(char) upcase(
---------------------------------------------------------------------
This function returns the upper case of the character sent to it.
******************************************************************************
* *
* Functions in file: *
* *
* ( Note 1 ) ( Note 1 ) *
* *
* JJBQC.OBJ & JJBQCINP.OBJ & JJBQCDOL.OBJ & *
* JJBTC.OBJ JJBTCINP.OBJ JJBTCDOL.OBJ *
* --------------- --------------------- ------------------- *
* *
* jjb_initalize() input( input_dollar( *
* jjb_start() input_num( enter_dollar( *
* group( input_lnum) *
* option( enter( *
* init( enter_num( *
* leave( enter_lnum( *
* help( Plus additional functions *
* default_opt() you can use to make *
* dosexit( your own input and *
* plus the other enter functions *
* functions listed *
* above *
* *
* Note 1: The complete source for these object modules will be sent to *
* users who register with JJB. *
* *
******************************************************************************
******************************************************************************
* *
* jjb_start() *
* *
* This function, in its simplest form, is a continuous loop. *
* *
* *
* while (1) { *
* *
* execute the function initalizing the group, if any. *
* *
* execute the function initalizing the option, if any. *
* *
* -------> execute the function for the option. *
* (long jump to here when changing options. *
* execute the function leaving the option, if any. *
* *
* execute the funtion leaving the group, if any. *
* *
* } *
* *
* Changing options does a long jump back to this loop finishing up the *
* option and group and starting a new one. *
* *
******************************************************************************
******************************************************************************
* *
* Functions you may use in jjb_setup(): *
* *
* group( Start a new group of option & assign group description. *
* *
* option( Define the next option by assigning a description *
* *
* funct( Assign a function name to an option. *
* *
* init( Assign a function name to initalize group or option. *
* *
* leave( Assign a function name to exit a group or option. *
* *
* default_opt( Tag this option as the default option. *
* *
* help( Assign a function name for F1 help key. *
* *
* dosexit( Assign function be be executed when exiting to DOS. *
* *
* set( Change variable or switch setting in the integer array *
* *
******************************************************************************
******************************************************************************
* *
* char * input(int length) *
* char * input_num(int length, int from, int to) *
* char * input_lnum(int length, long from, long to) *
* char * input_dollar() *
* *
* These are high-level programming functions. They all return the address *
* of the string input. The complete source comments will be sent to users *
* who register with JJB. *
* *
******************************************************************************
======================================================================
*** JJB REGISTRATION FORM ***
======================================================================
To print this form from DOS enter: TYPE JJB-FORM.DOC > PRN:
Registration entitles you to:
1. The latest version of ALL JJB software.
2. The JJB manual (refered to as the printed documentation).
3. The complete source code with comments for the all input and
and enter functions which are designed so you will be
abto to easily make your own enter functions.
4. Free technical support.
5. The JJB newsletter.
To register, fill out this form and return it along with your check to:
JJB
9236 Church Rd, Suite 1082
Dallas, Tx 75231
----------------------------------------------------------------------
Date _______________
Name: _____________________________________
Address: _____________________________________
_____________________________________
_____________________________________
Phone: (____) _______________
$ 49.00 JJB Registration
(Sales tax for Texas residents only. 8% )
3.00 Shipping and Handling ($10 US dollars if overseas)
-------------
Check amount payable to: JOHN JAMES BRODERICK or JJB
=============
COMMENTS AND SUGGESTIONS: