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


If you need the path to the GHS Program folder, you may wish for a system variable with a name like PROGDIR. Alas, there is none. This is the first COW about a command which doesn't exist.

But when would you ever need the path to the GHS Program folder in a variable? After all, the Program folder's location is no mystery: the command MESSAGE PATH shows it on the screen.

If you are seeing through this pretense, perhaps you remember that there is a PROGDIR variable in PMX. In COW038 there was mention of transmitting information from PMX to GHS. You could get your PROGDIR that way.

Click here to see three ways to go about getting the path from PROGDIR in PMX and transferring it to a GHS variable. Warning: these are what a programmer would call kludges (the fact that a kludge works to some degree is the only good thing that can be said about it). Nevertheless, these examples might be worth looking at for what else they demonstrate.

Now to get serious. GHS has something better than PROGDIR, namely PATHHERE, which is a system variable or function that returns the path to the current folder.

A reasonable use for PATHHERE is to help you include in your report the path to the working folder:

\Working folder is {PATHHERE}\

If the files used to produce the report are in a working folder, it is nice to have recorded in the report output exactly where the working folder is located without having to code it literally in your run file.

For anyone who still wants PROGDIR in GHS, here is the way to make one yourself without using PMX:

CHDIR "{WorkFolder}"

That nifty ^^ notation can be used in COPY commands too. It is your way of saying PROGDIR in the GHS command language.

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