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 ^^my.gf
variable (st) s="{GF}"
clear
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}
write variable.gf
clear
quit PM
set error=-4
read variable.gf
clear
\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.

support@ghsport.com

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

www.ghsport.com

Click here for an index to this and previous COWs