PIPE

<< Click to Display Table of Contents >>

Navigation:  Gekko commands >

PIPE

Previous pageReturn to chapter overviewNext page

Redirects output to a file (or back to the screen). Directing to a .html file is supported.

 

If you are going to pipe only parts of your Gekko output to an external file, it is recommended to start at pipe with PIPE [filename];, and then use PIPE<pause>; and PIPE<continue>; to start and stop piping to the file (and PIPE<stop>; at the end of the session). If you instead use PIPE<stop>; and PIPE [filename]; to switch piping to the same file off and on, the external file may become blocked (and the program will run slower, too).

 

If you just want to suppress screen output, without directing it to an external file, you may use OPTION interface mute = yes; (if PIPE is used, the file writing is suppressed).

 

 


 

Syntax

 

PIPE < HTML  APPEND  PAUSE  CONTINUE  STOP > filename ;

 

HTML

(Optional). If this option is used, Gekko will insert the text into the <body> of an existing html file (if appending), or create a html file from scratch to write into. Note that Gekko appends text to the .html file without any prior formatting. So for instance to append a line to a .html file, you have to include the html tags (for instance: TELL '<p>Hello</p>';). Html output is reasonably simple to convert into pdf.

APPEND

(Optional). If this option is used, the output will be appended to an existing file, otherwise the file is overwritten (if it exists to begin with).

PAUSE

(Optional). Sets piping on pause

CONTINUE

(Optional). Starts piping again

STOP

(Optional). Stops piping altogether.

filename

(Optional, not used with PAUSE, CONTINUE, STOP options).

Filenames may be contain an absolute path like c:\projects\gekko\myfile, a relative path like \gekko\myfile.gbk, or be stated without a path. Filenames containing blanks and special characters should be put inside quotes. See more on filenames here.

 

Any pre-existing file with the same name will be overwritten, unless option APPEND is used. If PIPE<stop> is used, the output is re-directed to the screen.

 

 


 

Example

 

You may want to keep a print of some variables in an output file:

 

READ adambank;
PIPE ex.out;
PRT fy ul;
PIPE <stop>;

 

The file ex.out now contains the variable print. If you instead use PIPE <append> ex.out;, the existing ex.out file will be appended to.

 

The following illustrates piping to html:

 

PIPE <html> out.html;
TELL '<p>This is the first line</p>';
TELL '<p>This is the second line</p>';
PIPE <stop>;

 

Afterwards, you may open out.html in a web browser to see what it looks like. If you need to pause and continue piping, you may use this:

 

PIPE text.txt;
TELL 'a';
PIPE<pause>;
TELL 'b';
PIPE<continue>;
TELL 'c';
PIPE <stop>;

 

After this, the file text.txt only contains 'a' and 'c', but not 'b'. If you put TELL statements between PIPE<continue> and PIPE<pause> statements, you will make sure that only the TELL's end up in the file.

 

 


 

Note

 

When piping, any error messages are also piped to the file. You may consult the 'traffic lights' in the lower right corner of the Gekko window, in order to see if an error occurred and the program aborted (in that case, the light will be red - a running program is shown as yellow).

 

 


 

Related options

 

OPTION folder pipe = [empty];

OPTION interface mute = no;