Lines
FISH programs can be embedded in a FLAC3D data file, or may be entered directly into the console. Lines following the word fish define
are taken to be statements of a FISH function. The function stops when the statement end is encountered. A valid line of FISH code must take one of the following forms:
The line starts with a statement, such as if, loop, etc. (see the FISH statements).
The line contains one or more names of built-in or user-defined FISH functions, separated by spaces (for example, fun_1 fun_2 fun_3).
The line consists of an assignment statement (i.e., the expression on the right of the = sign is evaluated, and the value is given to the variable or function name on the left of the = sign).
The line consists of a FLAC3D command, provided that the line is embedded in a section of FISH code delimited by command - endcommand.
The line is blank or starts with a semicolon.
FISH variables and statements must be spelled out in full: they cannot be truncated, unlike FLAC3D commands.
FISH built-in library functions may use abbreviations if the name contains a ‘.’ and the result is unambiguous.
Continuation lines are allowed with the ... control statement at the end of the line.
FISH is “case-insensitive” at all times. Spaces are significant (unlike in FORTRAN) and serve to separate variables, keywords, etc.; no embedded blanks are allowed in variable or function names. Extra spaces may be used to improve readability (for example, by indenting loops and conditional clauses).
Any characters following a semicolon ( ; ) are ignored; comments may be embedded in a FISH program by preceding them with a semicolon. Blank lines may be embedded in a FISH program.
Inline FISH
In addition to the typical insertion of FISH via fish define
, valid FISH statements may be included as their own lines as FISH fragments or within a command using the inline FISH facility. Anything found inside square brackets ( [ ] ) is interpreted in-place and immediately evaluated. This can be an efficient and preferable mechanism for simple, shorthand FISH operations. See Executing FISH: Inline FISH or FISH Fragments for further information.
Was this helpful? ... | Itasca Software © 2024, Itasca | Updated: Aug 13, 2024 |