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

GHS for Everyone

Have you wondered why GHS offers several ways to accomplish the same task? Different personality types see things differently and prefer different ways of doing things.

For example, suppose you want to include in your report the path to the GHS Program folder regardless of where it is and even if you don't know where it is. How would you do it?

Here are four different approaches. You may like one better than the others, depending on your personality type.

For the programmer at heart:

read ^^
variable (st) s="{GF}"
variable i
set i=chars "{s}" minus 5
set s=left {i}, "{s}"
\The GHS Program folder is {s}
`Note: Be sure to reload your GF after doing this.

For the know-it-all:

enter PMX /direct
STR programdir
set programdir={progdir}
quit PM
set error=-4
\The GHS program folder is {gf.programdir}
`Note: Uses the GF module in which PM-defined variables show up.

For the person who follows the latest developments:

enter pmx /direct
fout (create) temp.txt
fout (eval) {PROGDIR}
fout (close)
quit pm
variable (str) s
read (data) temp.txt
read s
read (data) off
erase temp.txt
\The GHS program folder is {s}
`Note: This new file output feature in PMX is great!

For the simple minded:

variable (str) savehere={PATHHERE}, progdir
chdir ^^
set progdir="{PATHHERE}\"
chdir "{savehere}"
\The GHS program folder is {progdir}

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