[comp.binaries.ibm.pc.d] v09i049: anaclock, analogue clock prog

ts@uwasa.fi (Timo Salmi) (12/06/90)

In article <2470@sixhub.UUCP> ibmbin-request@crdgw1.crd.ge.com writes:
>Checksum: 2747926683  (Verify with "brik -cv")
>Posting-number: Volume 09, Issue 049
>Submitted-by: bobmon@iuvax.cs.indiana.edu
>Archive-name: anaclock/part01
>
>Another cute little clock program.
>
>The submitter says:
>
>  Source and executable for a program that displays an analog clock
>face on a CGA display.  Might work on EGA & VGA (I'll try it Real Soon
>Now). I've included Turbo C cga.bgi and egavga.bgi files, at least one
>of which is needed for the program to run.  The .bgi file may be in the
>same directory as the program, or in the current directory, or in a
:

A comment for the would-be programmers.  Borland's graphics drivers
can be included in the program code, and the user can (and should)
be saved the hassle of needing the separate .bgi files.  The
inclusion is unfortunately not very easy to do for the first time,
but it certainly adds a bit of professionalism to publicly
distributed programs (and many bits of code :-). 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

bobmon@iuvax.cs.indiana.edu (RAMontante) (12/06/90)

me:
| >  Source and executable for a program that displays an analog clock
| >face on a CGA display.  Might work on EGA & VGA (I'll try it Real Soon
| >Now). I've included Turbo C cga.bgi and egavga.bgi files, at least one
| >of which is needed for the program to run.  The .bgi file may be in the
| >same directory as the program, or in the current directory, or in a
| :
| 
ts@uwasa.fi (Timo Salmi) <1990Dec5.183751.2851@uwasa.fi> :
| A comment for the would-be programmers.  Borland's graphics drivers
| can be included in the program code, and the user can (and should)
| be saved the hassle of needing the separate .bgi files.  The
| inclusion is unfortunately not very easy to do for the first time,
| but it certainly adds a bit of professionalism to publicly
| distributed programs (and many bits of code :-). 


True, I could have linked the driver in, at a cost of making the executable
bigger.  No big deal if this is the only program running that uses it;
but if one already has (or will have) some other program around that needs
the driver, then it is purely redundant%.

Also, which driver do you want me to link in?  CGA, since that's the only
one that I've tested or have any use for?  EGAVGA, because perhaps it
makes a more lovely display on systems that can support it?  Both?  If
that's possible I missed the fact in the documentation.  I dunno.
I went with flexibility.


% It might be a tad faster to have the driver linked in... but I wrote
this thing to make use of an otherwise idle pc screen.  I should worry
about shaving milliseconds?

mlord@bwdls58.bnr.ca (Mark Lord) (12/07/90)

<The submitter says:
<
<  Source and executable for a program that displays an analog clock
<face on a CGA display.  Might work on EGA & VGA (I'll try it Real Soon
<Now). I've included Turbo C cga.bgi and egavga.bgi files, at least one
<of which is needed for the program to run.  The .bgi file may be in the
<same directory as the program, or in the current directory, or in a
<path specified on the command line.  Try `-d' to see it run fast
<(whoopee) or `-h' to get a syntax statement.
<
<If I get feedback I might jazz it up, document it, etc.

Here's a suggestion you may find convenient:

Link the BGI files into the executable, so that the clock program becomes
a fully self-contained module.  This would make it easier for me to use,
and perhaps some others as well.  The Borland manuals explain how to do this,
using BGITOOBJ (BGIOBJ ?) to create cga.obj and egavga.obj, which are then 
linked along with the program into one happy executable.
-- 
 ___Mark S. Lord__________________________________________
| ..uunet!bnrgate!mlord%bmerh724 | Climb Free Or Die (NH) |
| MLORD@BNR.CA   Ottawa, Ontario | Personal views only.   |
|________________________________|________________________|

bobmon@iuvax.cs.indiana.edu (RAMontante) (12/09/90)

mlord@bwdls58.bnr.ca (Mark Lord) <5068@bwdls58.UUCP> :
| Here's a suggestion you may find convenient:
| 
| Link the BGI files into the executable, so that the clock program becomes
| a fully self-contained module.  This would make it easier for me to use,
| and perhaps some others as well.  The Borland manuals explain how to do this,
| using BGITOOBJ (BGIOBJ ?) to create cga.obj and egavga.obj, which are then 
| linked along with the program into one happy executable.

Having been informed that I can link both .BGI files in, (and since I hope
to have a personal interest soon :-) I'll do that.  Thanks, Timo.

The manual wasn't *that* clear...

Discussion:  When I encountered these .BGI files, I thought, "How
interesting!  Now I can share one copy of this code amongst many
programs, instead of storing a separate copy in every program file that
does graphics.  Shared libraries on our favorite approximation to a real
OS!" :-).  Evidently this idea isn't very exciting to everybody else,
who keep telling me that I don't have to share the code, I can put a
separate copy into every program....  Is it that I'm hoarding disk space
more tightly than others, or does no one use enough of these graphics
files for it to matter?  Or what?

Living in the Shadows again...
bob,mon.