Classic Computer Magazine Archive COMPUTE! ISSUE 92 / JANUARY 1988 / PAGE 91

Time Stamp For IBM

Lawrence H. Bannister

Have you ever found yourself knee-deep in printouts, unsure which was the latest version? Or have you ever wanted to check the execution time of a program and had to look for a stop­watch? If so, the program accompanying this article is just what you need. With it, you can stamp the system time on any screen. DOS 2.0 or higher is required, along with BASICA for the PC, GW-BASIC for compatibles, or Cartridge BASIC for the PC Jr.

One of the nicest things about the PC is the PrtSc key, which allows you to print the current screen. This makes it easy to get quick printouts of portions of program listings, spreadsheets, databases, or word processor text. The only problem with using the PrtSc key is that you have no way of knowing when a particular screen was printed. If you've been working for several hours and have numerous versions of the same screen, it's difficult to tell which is the most recent.

"Time Stamp," the program accompanying this article, solves this problem by allowing you to display the current system time in either the upper right-hand corner of the screen or on the command line.

Getting Started

Time Stamp is a BASIC loader. Type in the program, save a copy to a disk, and then run it. It will create the executable program called SHOWTIME.COM on the same disk. (After you've used the loader to create SHOWTIME.COM, you won't need it again.) You can rename SHOWTIME.COM any legal filename you'd like, as long as it has an extension of .COM. To run Time Stamp, simply type SHOWTIME (or whatever name you used for the file) on the command line at the DOS prompt. Your PC will respond with

Resident code loaded at nnnn

where nnnn is Time Stamp's address in the memory of your particular machine.

Time Stamp is a resident utility, so after loading it into your PC or compatible, you will always have the two Time Stamp functions available. The key combination Alt-1 (holding down the Alt key while pressing the number 1 key on the top row of the keyboard), will display the current system time in the upper-right corner of the screen. The key combination Alt-2 also displays the current system time, but this combination places the time stamp at the end of the line the cursor is on. (If you don't have a battery-operated clock on your PC, be sure to set the correct time when you boot the system.)

Using The Program

The first of Time Stamp's two functions—placing a time stamp at the top-right corner of the screen—is particularly useful when you're writing a document with a word processor or writing a program, and you use Shift-PrtSc frequently to keep a record of your work. Each piece of paper will be stamped with the time at which it was printed, so there never will be any doubt about which is the latest version.

Using Time Stamp is simple. All you need to do to place the time stamp on your screen is press the AIt-1 combination. Then press Shift-PrtSc to print your screen. Please note, however, that some applications may either use the Alt-1 combination for a command themselves or treat pressing it as an error. In either of these situations, Time Stamp may not work properly.

The second function, which places a time stamp at the end of the line on which the cursor is currently located, provides a convenient way to check the running time of a program or a long loop in a program. Simply press Alt-2 immediately before Enter to start your program, and press Alt-2 again when it ends. The starting time will stay with your command line as your program outputs to the screen and the screen scrolls up. You can also press Alt-2 while your program is running to place a time stamp at the end of any intermediate output line.

Using Time Stamp With BASIC

In a few cases, you may have to modify your command procedure slightly if you want to use Alt-2 to place a time mark at the end of a command line before you execute it.

For example, if you use Alt-2 and then press function key F2 to run a BASICA program, BASIC will think that the time mark is intended to be a line number and will report an error.

This minor problem is easily solved. Don't use the F2 key. Instead, type RUN followed by a single apostrophe to denote a comment, then press Alt-2 to place the time mark on the command line. Finally, press Enter to execute the command.

Deleting Time Stamp

If Time Stamp has been installed and you want to delete it—to free the memory space—simply run it again. You'll receive the message

Resident code deleted

If you need Time Stamp back, just run it again, and it will load itself into memory exactly the way it did the first time.

Time Stamp

For instructions on entering this program, please refer to "COMPUTE!'s Guide to Typing in Programs" elsewhere in this issue.

GN 10 'Copyright 1988 COMPUTE! Publications, Inc. - All Rights Reserved
NB 20 'SHOWTIME. BAS Used Once to create SHOWTIME.COM
OP 30 GOTO 860
ND 40 DATA E9, 56, 01, 9C, 9A, 00
LC 50 DATA 00, 00, 00, 1E, 50, 53
PN 60 DATA B8, 40, 00, 8E, D8, BB
PH 70 DATA 1C, 00, 8B, 07, 48, 48
AB 80 DATA 3B, C3, 75, 03, B8, 3C
KL 90 DATA 00, 8B, D8, 8B, 07, 3D
DI 100 DATA 00, 78, 74, 09, 3D, 00
LL 110 DATA 79, 74, 04, 5B, 58, 1F
PI 120 DATA CF, C7, 07, 00, 81, 8C
JG 130 DATA CB, 8E, DB, A3, 14, 02
BP 140 DATA FB, 51, 52, 57, 56, B4
QI 150 DATA 00, CD, 1A, 8B, C1, D1
N0 160 DATA E1, D1, E1, D1, E1, 2B
I0 170 DATA C8, 2B, D1, 73, 01, 48
KB 180 DATA B1, 04, D3, E0, F6, C4
LC 190 DATA 01, 74, 03, 05, 60, 00
JL 200 DATA 3C, A0, 72, 03, 05, 60
ND 210 DATA 00, D2, E8, 05, 30, 30
BD 220 DATA 88, 26, 16, 02, A2, 17
MO 230 DATA 02, D1, EA, 8B, CA, D1
LK 240 DATA EA, 03, D1, B4, 06, 8A
MA 250 DATA C6, D1, E0, D1, E0, D1
LA 260 DATA E0, 81, E2, FF, 1F, 88
DA 270 DATA 26, 19, 02, 8B, CA, D1
IN 280 DATA E1, D1, E1, 03, D1, B4
HD 290 DATA 03, 8A, C6, D1, E0, D1
GN 300 DATA E0, D1, E0, D1, E0, 81
GM 310 DATA E2, FF, OF, 88, 26, 1A
PL 320 DATA 02, 8B, CA, D1, EA, 03
PC 330 DATA D1, D1, EA, D1, EA, 80
NA 340 DATA C6, 30, 88, 36, 1C, 02
IE 350 DATA 32, F6, D1, E2, 8B, CA
DO 360 DATA D1, E1, D1, E1, 03, D1
DH 370 DATA 80, C6, 30, 88, 36, 1D
DD 380 DATA 02, B4, 0F, CD, 10, 50
HD 390 DATA B4, 03, CD, 10, 58, 52
IJ 400 DATA 8B, 0E, 14, 02, 81, F9
LH 410 DATA 00, 79, 74, 02, B6, 00
IK 420 DATA BA, D4, 80, EA, O8, B4
PD 430 DATA 02, CD, 10, BE, 16, 02
KI 440 DATA B9, 01, 00, 8A, 04, 3C
LG 450 DATA 24, 74, 0F, 56, B4, 0A
BP 460 DATA CD, 10, FE, C2, B4, 02
GF 470 DATA CD, 10, 5E, 46, EB, EB
OJ 480 DATA 5A, B4, 02, CD, 10, 5E
MC 490 DATA 5F, 5A, 59, E9, 19, FF
LE 500 DATA 00, 00, 00, 00, 3A, 00
EL 510 DATA 00, 3A, 00, 00, 24, 52
FB 520 DATA 65, 73, 69, 64, 65, 6E
DC 530 DATA 74, 20, 63, 6F, 64, 65
QP 540 DATA 20, 69, 6E, 73, 74, 61
LN 550 DATA 6C, 6C, 65, 64, 20, 61
GC 560 DATA 74, 20, 24, 52, 65, 73
BB 570 DATA 69, 64, 65, 6E, 74, 20
IO 580 DATA 63, 6F, 64, 65, 20, 64
EH 590 DATA 65, 6C, 65, 74, 65, 64
OJ 600 DATA 0D, 0A, 24, 30, 0D, 0A
FL 610 DATA 24, 00, 00, B4, 35, B0
DH 620 DATA 09, CD, 21, 8C, 06, 07
NB 630 DATA 01, 89, 1E, 05, 01, BF
CB 640 DATA 09, 01, 8B, F7, B9, 14
ED 650 DATA 02, 2B, CE, FC, F3, A6
EH 660 DATA 75, 29, BA, 3B, 02, B4
MK 670 DATA 09, CD, 21, B4, 35, B0
GD 680 DATA 09, CD, 21, 8D, 5F, 02
AD 690 DATA 26, 8B, 17, 8D, 5F, 02
GO 700 DATA 26, 8E, 1F, B4, 25, B0
NG 710 DATA 09, CD, 21, B8, 00, 49
FL 720 DATA CD, 21, B8, 00, 4C, CD
HK 730 DATA 21, BA, 1F, 02, B4, 09
BO 740 DATA CD, 21, 8C, CB, B9, 04
CO 750 DATA 04, 8B, D3, D3, C2, 8B
FD 760 DATA DA, 80, E2, OF, 80, CA
KF 770 DATA 30, 80, FA, 3A, 72, 03
JO 780 DATA 80, C2, 07, B4, 02, CD
HF 790 DATA 21, FE, CD, 75, E4, BA
DP 800 DATA 53, 02, B4, 09, CD, 21
NK 810 DATA BA, 1F, 02, B1, 04, D3
LG 820 DATA EA, 42, 89, 16, 57, 02
KF 830 DATA BA, 03, 01, B4, 25, B0
HM 840 DATA 09, CD, 21, 8B, 16, 57
HP 850 DATA 02, B8, 00, 31, CD, 21
NJ 860 WIDTH 80 : CLS : PRINT TAB (8) "Copyright 1988 COMPUTE! Publications, inc. - All Rights Reserved" : PRINT : PRINT
EI 870 CHKSUM = 0
HG 880 OPEN "0", #1, "SHOWTIME. COM" : FOR  I% = 1 TO 492
LB 890 READ A$
KC 900 J% = VAL ("H" + A$)
BP 910 CHKSUM = CHKSUM + j%
JK 920 PRINT #1, CHR$ (J%);
HM 930 NEXT I%
PG 940 CLOSE
CP 950 IF CHKSUM = 52556! THEN PRINT "SHOWTIME. COM Created" : END
HK 960 PRINT "ERROR : Checksum incorrect : Review all data Statements"
DP 970 KILL "SHOWTIME. COM" : END