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

(Requires GHS with LEw)

Most of us know that Load Editor provides a handy way to develop loading conditions and it is helpful to save and reuse those conditions later on in our run files. One method is to drop out of Load Editor, save the condition, and then return to editing the next condition.

The process of saving the condition can be accomplished rather easily, while inside Load Editor, using the WRITE (TANKS) command and a macro. The following run file makes this possible:

vari i=0
vari (string) filename="MILK.rf"

macro MOO
 set i={i} PLUS 1
 write (line) {filename} "
 write (line) {filename} "MACRO COND_{i}
 write (tanks) {filename} /append /brief /only
 write (line) {filename} "/

The macro above could be embedded in your LF file (see COW138), or the file simply run before entering Load Editor as follows:

load (*) edit /macro:"WrTanks"

[Those interested in the intricacies of buttons in LEw may find this old Did You Know article interesting.]

Once initialized, the macro will simply append the tank loads from the current condition in Load Editor into a run file called "cond.rf" whenever the button is pressed. The appended commands will be contained within a macro indexed by an integer value, meaning you can use Load Editor to save conditions in succession, and then recall any of the saved conditions with a simple macro call:

run MILK.RF /call /quiet

Note: WRITE(LOADS) could be used instead of WRITE(TANKS); see the second half of COW152 for more information.

"The cow is of the bovine ilk; one end is moo, the other milk." - Ogden Nash

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