Dec 112017
 
Insert this code in your DBASE IV program to allow user to select screen colors and printer drivers.
File SYSDEF20.ZIP from The Programmer’s Corner in
Category Dbase Source Code
Insert this code in your DBASE IV program to allow user to select screen colors and printer drivers.
File Name File Size Zip Size Zip Type
PRINTERS.DBF 4333 1298 deflated
PRINTERS.MDX 8192 2204 deflated
SYSDEF.DBF 742 304 deflated
SYSDEF.DOC 7878 2836 deflated
SYSDEF.PRG 27510 6332 deflated
SYSDEF_H.DBF 912 345 deflated
SYSDEF_H.DBT 10240 1746 deflated
SYSDEF_H.MDX 4097 1025 deflated
U_SYSDEF.PRG 6566 2104 deflated

Download File SYSDEF20.ZIP Here

Contents of the SYSDEF.DOC file




Documentation for SYSDEF.PRG
Version 2.0
(SYStem DEFinition)
6-19-90





Program By: Bill Ferguson
BF Computer Solutions
391 E. 118th Pl.
Northglenn, CO 80233
(303)457-4847
"Fergie" on A-T BBS








DISCLAIMER:
This program and associated files work fine on my system as follows:

CompuAdd 80286 16 mhz
Seagate ST251-1 40 meg HD
Diamond Flower EGA card
EGA monitor
Qmodem SST Telecommunication program

This program and it's associated files should, but may not, work on
all other PC and compatible systems.




The only renumeration or registration expected for this program is:

E-Mail to myself (Fergie) on the A-T BBS with -
1) Comments, both good or bad
2) Suggestions
3) After making your changes, if required, and if you decide
to include this in your own program, Acknowledge the
idea or implementation at least in your source code,
whether it's distributed or not.


















PURPOSE OF SYSDEF.PRG

I first wrote SYSDEF when I needed a program to change printer
drivers. The particular program/customer was for F.E.M.A., (Federal
Emergency Management Agency), who rents a computer system local at each
disaster site they go to. Since the hardware setup would in all probability
be different most of the time, and since I know from own experience that
colors that look good to someone else make me gag on my system, I needed
something fairly easy for the end-user to make needed adjustments.
After the upload of my orinal version, I noticed a lot of discussion
on the Ashton-Tate Support BBS regarding questions/problems with some of the
features of dBASE that deal with mono/color displays and the SET DISPLAY __
command. My system is EGA and I don't have access at this time to other
systems, but SYSDEF handles (for my system), most of the problems/questions
I read on the BBS. This new version includes an easier to understand screen
for color selection and I've fixed/(enhanced?) a problem I discoverd with
the printer settings.


USING SYSDEF

A good example of using SYSDEF is in my program REGISTRY, which
is on the ATBBS in the dBASE4 library, also. If you don't have a need for
that program though, I'll try to explain how to best implement SYSDEF in
your own program.

The following is copied from the SYSDEF source code:

*- This block needs to be copied into main the program, before the program &&
*- DOes the MPDEF routine, as it starts off with an ISCOLOR() statement. &&
*- &&
*- Also, copy the block (lines 86 - 93) to a disk file. Then copy them &&
*- into your main program and the main menu, wherever the SET COLOR OF ____ &&
*- commands are. These are found right after an IF ISCOLOR(). &&
*- &&
*PUBLIC g_norm_clr, g_mess_clr, g_tit_clr, g_box_clr, g_high_clr, g_info_clr &&
*PUBLIC g_fiel_clr, g_prin_prt, g_driver, g_loffset, g_lmargin, g_plength &&
*PUBLIC g_pspacing, g_peject, g_pwait, g_ppitch, g_pquality &&
*DEFINE WINDOW printemp FROM 08,25 TO 17,56 && needed by error procedure &&
*ON ERROR DO prntrtry && procedure generated by Apgen in main program &&
*IF FILE ("global.mem") &&
* RESTORE FROM global ADDITIVE &&
* _pdriver = g_driver &&
* _ploffset = g_loffset &&
* _lmargin = g_lmargin &&
* _plength = g_plength &&
* _pspacing = g_pspacing &&
* _peject = g_peject &&
* _pwait = g_pwait &&
* _ppitch = g_ppitch &&
* _pquality = g_pquality &&
*ELSE &&
* DO sysdef &&
*ENDIF &&
*ON ERROR &&
* &&
* &&
*SET COLOR OF NORMAL TO &g_norm_clr &&
*SET COLOR OF MESSAGE TO &g_mess_clr &&
*SET COLOR OF TITLE TO &g_tit_clr &&
*SET COLOR OF BOX TO &g_box_clr &&
*SET COLOR OF HIGHLIGHT TO &g_high_clr &&
*SET COLOR OF INFORMATION TO &g_info_clr &&
*SET COLOR OF FIELDS TO &g_fiel_clr &&
*SET PRINTER TO &g_prin_prt &&

As you can see, I included the important part for the main program in a block
that is non-destructive to the actual program and in what I assume would be
an easy to find format.
In your main program, copy the block starting with the PUBLIC
declarations and ending with the ON ERROR statement before your program
executes the MPDEF procedure, as MPDEF starts with an ISCOLOR() statement.
Next, use your word processors Search function to find all occurances of the
word COLOR in your main program and the initial main menu program. There will
be several lines/places in the main program that include an @ row,col SAY
followed with COLOR ____ (whatever you have APGEN set for). You either leave
those commands alone, or delete the COLOR part, it's up to you.
However, when you run across the IF ISCOLOR() line in your main program and
the main menu program, substitute those color settings with the block of
SET COLOR OF ____ commands above.
One more important part, and maybe the MOST IMPORTANT, is this
program assumes that there is a disk with printer drivers on it to insert
into the 'A' drive. What I did is make a separate disk containing nothing
but the printer drivers from the Developer's Edition System Disk #2 and
the updated drivers on the ATBBS. You may want to follow the same procedure
or change it. The nice thing about being able to do this is creating fancy
looking reports with varying prints styles for the customer and not worrying
about what printer they may have next year, so you can avoid hard-coding
printer features into your program.


CONCLUSION

I hope you find this program useful, either in your own applications
or as way to do something similar. I encourage all users to leave me comments
saying it was a waste of download time or something they found useful or
anything in between. As long as I get some kind of feedback, I don't care
if it's good or bad. Hopefully though, someone may find either the program
or the technique useful.

Enjoy!



 December 11, 2017  Add comments

Leave a Reply