General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)


In a previous COW, the KEY command was employed to convert the keyboard into a 12-note piano with autoplay capability. If you missed it, check out COW143 and be sure to download the run file. As amazing as that COW was, it may have fallen short of offering a realistic use case for the KEY command.

This COW will demonstrate a quick time-saving keyboard shortcut that might just improve upon your current GHS workflow. There are some who say the F5 key is the best way to run a file in GHS, perhaps even better than typing the command, or gasp, using the pull-down menu option. Wait, you don't use F5?

A good simple arrangement to use GHS with a run file efficiently is to open the run file in a text editor of your choosing, and open GHS in the folder where this run file is located. Your screen should look something like this.

Want a quick trick to start GHS with the working folder already set to your current location? Just make an empty text file with an *.RF extension.

The buttons at the very bottom of the GHS window correspond with the keys that have been configured. GHS has the following default function key associations:

1,"HELP *|", HELP
3,"VIEW "
4,"EDIT "
5,"RUN "
6,"PROJ "
7,"READ "

As you can see, the GHS session above has custom keys for GLM_MAKER, LOAD EDITOR, RUN, PRINT PREVIEW, and QUIT. Press the F5 key and you'll see a RUN prompt appear on the screen. You can type a run file name, or if the project has been set to match a run file name, just press enter. You can make this even more efficient, by adding the following line to GHS.LF:

KEY 5, "RUN |", "F5-Run"

In the command above, the first quoted string is the action and the second string is the label. Note the pipe ("|") symbol included at the end of the action. This symbol acts as a carriage return and can bind multiple commands to a single key. By adding the pipe to the F5 key, then matching the project name to the run file name, the sequence to update the run file and rerun the file is simple:
  1. Change the run file in Notepad (or chosen editor);
  2. Press Ctrl-S (or Alt, then F, then S) to save the file;
  3. Press F5 in GHS to run the file.
The savvy among you may recall that project names are limited to 8 characters. The key command comes to the rescue again. When the run file name is too long for our previous time-saver, just put a direct key command at the top of the file:

KEY 5, "RUN |", "F5-Run"

By the way, if you never use these key functions in your personal workflow or just don't want to see them, you can save space on your GHS window by entering KEY NOSHOW or turning off "Footer buttons" on the View Menu (see COW206). Note this just hides the footer line... the F5 key still works to run your files!

Now you can have a consistent and efficient way to rerun a run file that you are actively editing. Stay tuned for a future COW about an upgraded text editor!

Questions, comments, or requests?
Contact Creative Systems, Inc.

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

Click here for an index to this and previous COWs