for the
DEC Rainbow PC

For The Rainbow
Running MS DOS

By Jeff Cameron
email :
Web :

Version 3.0

 Download the file

This is version 3.0 of STARTREK. Many new features have been added to the game. Every effort has been made to remove all known bugs, and to make the game as challenging, fun and easy to play. The game is now ready to play, if all the required files, are in the current default disk and directory. Just enter in STARTREK at the DOS prompt.

Required Files :


The game will play without the last two files, but the game instructions and Command help will not be available

If STARTREK is entered with no other command line parameters, the game will create a file called STSCORES.HST if none exists. For more information, see the section on "History Files", below.

Learning how to play :

This game is based on the standard command based version of STARTREK. There are many other versions available that may be better, but this one is for all those "ORIGINAL" Star Trek fans, that were there on Friday, September the 8th, 1966, when NBC was premiering the "Sneak Preview" of their answer to CBS's "Lost In Space".

The game may create one file in the current default DOS directory, only if none exists. The name of the file is STSCORES.HST, and it contains the history of the top ten best scores for each class. This distribution of STARTREK contains a history file of the Author's best games. For more on history files, read on.

The game asks you if you want instructions. The instructions are on the file TREK.INS. This file contains ANSI Escape sequences so it can be typed on the RAINBOW PC (VT102 or higher) screen or printed to a DEC LN03, LA50, or compatible printer.

The instructions are quite extensive and are written in two sections. The first part is designed to give you a general overview. Just enough to get you started. The second section describes some of the many details of the game.

In addition to the instructions at the beginning of the game, you can enter the command "COMMANDS", which will give you a list of all the valid commands for the game, and a complete description of the syntax and function of each command. This information is also kept in a text file with ANSI escape sequences, suitable for VT102 or compatible, LN03, LA50 or LA100 ... etc. The file is called TREK.CMD.

The game is capable of recording it's current state on a file to be replayed at a later date or time. The OLD and the SAVE commands allow you to restart an old game, or save the current state respectively. When you use these commands the game will ask for a file name. You may specify a device and directory, but if you omit them, STARTREK will look in your current default DOS directory for the file. You may also specify any extension for the file, and if you do not, then .SAV is the default.

STARTREK is also able to keep a record of the scores of it's best players. This is done in a "History File". The History File saves the records of the top 10 best players for each game level (Novice, Fair, Good, or Expert). One such history file, of the author's best scores, is provided with the distribution of the game. There is no facility, yet, to combine history files.

Along with this distribution is a program called BESTSCOR, which will report the best scores stored in a history file. If you just enter in the command BESTSCOR, you will get a listing of the best scores for the normal game history file (STSCORES.HST), or you can enter the file name of another history file on the command line, to report on another history file. For example, the command :


will give a report on the current best scores done by myself.

Considerations :

o This program is written in Turbo Pascal 3.0 (© Borland International) specifically for the Digital Equipment Corporation RAINBOW PC-100.

o To run the game, just type in the command STARTREK and the game will run if all of the needed files are in the current default directory. If you want to play the game, and all of the needed files are in another directory, you must include a path specification on the command line. Ie:


o Although STARTREK will run from a floppy disk, it is best run from a hard disk or better yet a ram disk. STARTREK uses a direct access message file and overlays, and can be quite disk intensive, which will slow down responsiveness if the files are on a slow device.

o As a suggestion, copy the files STARTREK.COM, STARTREK.000, TREK.MSG, TREK.CMD, and TREK.INS to a directory that is in your MS/DOS path. Let's say you keep all of your games programs in a directory in your path called E:\GAMES. Copy the 5 files into that directory and create a batch file in the same directory that contains the one command :


If the batch file is called ST.BAT, then each time you enter ST to the DOS prompt, the game will begin, regardless of what your current default disk and directory are. It would be best to have the directory on a ram disk to speed up game response.

o When STARTREK is waiting for you to enter a command, it is consistently updating the display, and reacts to keyboard interrupts. This can be stopped and held by entering in the command HOLD.

MS/DOS Command line syntax :


STARTREK [PATH=pathname] [SNAP=snapfile] [HIST=histfile]

Where :

pathname Is any valid MS/DOS device, and path or directory specification.

snapfile Is any valid MS/DOS file specification,

histfile complete with optional device, and directory specifications.


This DOS command line parameter allows you to specify the location of all of the required game files, and the optional instruction and command file. If you omit this command line parameter, then "PATH=." (or the Current default directory is the default. If both PATH=, and HIST= are specified, the PATH= parameter must be before the HIST= parameter.

(I shouldn't be telling you this one.) This command line parameter allows you to specify a "Snapshot" file. If you specify this option, a snapshot of the entire current game is placed in the specified file just after you enter a command, and just before the command is executed. The snapshot file is in a format that can be read by the OLD command. If you think you might do something stupid, where you might get yourself killed, this option gives you the ability to pick up the game just before you made a stupid move. (WARNING: Use of this option slows game response considerably.)

This command line parameter specifies the path or file to be used as a game history file. You may specify : HIST=NONE, or HIST=NUL to disable this option. If you do not specify a history file, then the program looks for a file in the current game file path, as specified by the PATH=pathname parameter above. If still no file is found, the game will automatically create it in the game file path directory.

The HIST=histfile can either be a file specification, a directory specification, or a combination of both. A directory specification must end with the "\" character, and may, or may not, contain a device specification. A file specification or combination of both must end with the ".HST" extension.

If just a directory is specified, the filename will be STSCORES.HST. If just the file name is specified, then the game will check both the current default directory and the game files path for the file specified. If no existing file can be found, it will be created in the current game files path directory.

File descriptions :

README.TXT This file. (Not Necessary for the game.)
STARTREK.COM Executable image. (Required file)
STARTREK.000 Overlay file. (Required file)
TREK.MSG Direct access message file (Required file)
TREK.INS Beginning instructions file (Optional file)
TREK.CMD Command documentation file (Optional file)

Additional files :

STSCORES.HST Default history file. (Created by playing game)
BESTSCOR.COM Program to read and report best scores from a history file.
AUTHBEST.HST History file containing the author's best scores.


Credits :

STARTREK is released into the public domain, and can be copied freely. It cannot be bought or sold. The name STARTREK is © Paramount Pictures Corporation, 1969. Your comments, suggestions, bug reports, and enhancement requests are solicited.

Please send your correspondence to the author ...

Jeff Cameron
22533 S. Vermont Ave. #59
Torrance, Ca. 90502

STARTREK is about 20,000 lines of Turbo Pascal code. I do not include the source with this distribution, however, I can easily be persuaded to release the complete source and development aid tools used to develop the game, at no cost. So if anyone is interested in adapting it to another host, please let me know.

Much of the game's syntax, functionality, and online documentation are based on the classic original STARTREK game, initially developed by David Matuszek and Paul Reynolds. Additional credits are due to Don Smith and M. Kellogg for their modifications.

Apologies :

o Please forgive my misspellings. (Some of them are intentional, but most are not.)

o Prior to version 2.0, there was an automatic "Blow Up" date built in that deleted all the distribution files. This has been removed.

o STARTREK was an exercise in PASCAL for me. I am a "die-hard" FORTRAN programmer and I'm not afraid to use "GO TO"s. Some of the games reactions are evident of this.

Enhancements :

(1.2) Screen status display has been optimized, so that display of status, and location in the galaxy and quadrant are only done once per command, and only if needed.

(1.2) Addition of the command line parameter "PATH=pathname" to specify directory for needed game files.

(1.2) Addition of the command line parameter "SNAP=snapfile" to specify a snapshot file.

(1.2) New display for Enterprise self destruct, and Klingon Commander self destruct.

(1.3) Inclusion of the Time and Energy Bars, on the left of the Galaxy display, and the Photon Torpedo indicators on the right of the quadrant display.

(1.3) Version 1.3 uses some of the extended features of Suitable Solutions MS-DOS version 3.10, but will run under Digital Equipment's MS-DOS version 2.11.

(2.0) Implementation of the commands ABANDON, CRYSTALS, MINE, SHUTTLE, and TRANSPORT. This involves new features, like being the captain of the USS Lollypop, mining and loading Dilithium crystals, and visiting various planets.

(2.0) "Last good command" recall by pressing the F13 (LF) key.

(2.0) Addition of the new command, HOLD. This command holds the current game at its current state. If you walk away from the game while it is running, it will go into the hold state on its own, after about 10 minutes. The HOLD command goes into this state immediately.

(2.1) Implementation of the History File capability.

(2.2) Different "End of game" messages, based on if you win or loose.

(2.2) At least one commander transport if playing as a Novice.

(2.2) If you dock with Dilithium crystals, you are granted more time.

(2.2) If run into the edge of the galaxy with Dilithium crystals, you are in for unpleasant results.

(3.0) Some sort of indication has been added when you are in the same quadrant with a planet with dilithium crystals. But only under certain conditions. There may be crystals on a planet, and you may not know until you beam down.

(3.0) Commands involving flashy displays, have been optimized so display is minimized, if there are characters in the type ahead buffer.

(3.0) Display of the time and energy bars and the status text has been optimized to only update when necessary.

(3.0) If something unexpected happens during the course of the game, the typeahead buffer is purged so you don't execute a command that you have already entered.

Bug Fixes :

(1.2) At the beginning of the program, if you choose to play an old game, the orientation of the items in your quadrant was not retained from the saved game. This problem has been corrected.

(1.2) Restoring an old game from a file that was not created by the STARTREK program caused runtime error aborts. There are now file validity checks. (NOTE : Games saved with one STARTREK version, will not work with a different version.)

(1.2) There was a condition when a Klingon Starbase is created somewhere in the galaxy, and you shoot phasers before moving to a new quadrant would cause a runtime error abort. This problem has been fixed. (This is an obscure problem caused by a typo. If you have the 1.1 version, try shooting phasers right after you get the message that a Klingon base has been established. Amusing results may occur before the actual Runtime error aborts the program.)

(1.2) There was a bug that occurred when all Klingons are killed, except for the Klingon Starbase. In version 1.1 the game ended. In version 1.2 you must kill the Klingon Starbase too, in order to win the game. Just to make life interesting.

(1.2) In version 1.1, if you are in hyper space, enemy hits added to your ship energy and shipboard systems to no limit. This caused eventual problems later in the game. In version 1.2 shipboard system levels are limited, and if ship energy rises too high, the Enterprise explodes. We have to keep the game in line with physical laws.

(1.2) Version 1.1 did not allow the entry of the characters ":", "\", and "_" on the command line. Version 1.2 allows these characters for specifying files for the OLD and SAVE commands.

(1.2) Version 1.1 would inflict casualties if the Life Support Systems were down while you are docked. Version 1.2 corrects this problem. If you are docked, your life support systems are supported by the starbase. (You get the break on this one.)

(1.2) Version 1.1 would sometimes create a Klingon Starbase in the same quadrant as a Federation Starbase. This gives you an unfair advantage insofar a scoring points. This will no longer occur. Sorry!

(1.2) Version 1.1 would refresh enemies too much when you rest. Now they can only get so strong.

(1.2) On occasion, when your ship was destroyed by an enemy attack, and all of your crew lost because of it, you would then be told that you are alone in your ship, and that you cannot pilot it alone. This has been fixed so that you die with your ship.

(1.2) On rare occasions, when you select a "Short" game, the game would get stuck in an infinite loop, in attempt to initialize the game. This problem will no longer occur.

(2.1) In version 2.0, if you had some Dilithium crystals on hand and you requested to load 0 (zero) crystals, you would be granted the power of the crystals for the next turn, giving you an unfair advantage. This is no longer true.

(2.2) In previous versions, you used to be able to continually kill all invaders except the Klingon starbase, and leave the quadrant, allowing the Klingon base to create more enemies. Each time you killed Klingons, you would be granted more time, but when the base created new enemies the time before the overthrow of the Federation.

(2.2) Because of the previous problem, it was possible to gain enough points, such that it would overflow the maximum for a 16 bit Integer (MAXINT). The score limit is now MAXINT squared (Try and get that far. My best score was 46870). This bug fix makes history files and saved files from earlier versions incompatible.

(2.2) When you mined Dilithium crystals, you were incorrectly informed that the number found is that of your total supply, rather than that which was actually mined.

(2.2) During the initialization of a game, when you are prompted for your secret code word, and your code word was 8 characters (the maximum), it would go directly to the verification prompt without entering a carriage return.

(3.0) In prior versions, you could constantly go into a quadrant containing a Klingon Starbase, and kill everything in it except the Klingon Starbase, then leave and come back, continually racking up points, and granting you more time. This was especially easy if you had any Dilithium crystals loaded. Now, if Klingons are added to the universe, your time limit diminishes just a bit more than it increases as you kill them.

(3.0) Use of transporters and/or the shuttle craft now use a small amount of time and energy instead of none.

(3.0) The total Klingon count in the status display now counts the Klingon Starbase, even though it does not show up on Long Range Sensors.


¹ © 1988 Suitable Solutions Inc.

² © 1981,82,83,85 Microsoft Corp.

³ © 1986,87,88 Digital Equipment Corp.


Send me your question.


My Home Page | VMS Home

DCL | Utilities | Management | Tips

FORTRAN | Pascal

eMail Questions