Previous Next Chapter

Format

FILENOTE [FILE] <file | pattern> [COMMENT <comment>] [ALL] [QUIET]

Template

FILE/A,COMMENT,ALL/S,QUIET/S

Location

C:

FILENOTE attaches an optional comment of up to 79 characters to the specified file or to all files matching the given pattern.

If the <comment> includes spaces, it must be enclosed in double quotation marks. To include double quotation marks in a filenote, each literal quotation mark must be immediately preceded by an asterisk (*) and the entire comment must be enclosed in quotation marks, regardless of whether the commend contains any spaces.

If the <comment> argument is omitted, any existing filenote is deleted from the named file.

Creating a comment with FILENOTE is the same as entering a comment into the Comment gadget of an icon's Information window. Changes made with FILENOTE are reflected in the Information window, and vice versa.

Use the LIST command to view comments made with FILENOTE. If a file has comments, LIST displays them below the file name.

When a existing file is copied to (specified as the TO argument of a COPY command), it is overwritten, but its original comment is retained. Any comment attached to a FROM file is not copied unless the CLONE or COM option of COPY is specified.

If the ALL option is given, FILENOTE adds the <comment> to all the files and subdirectories matching the pattern entered. If the QUIET options is given, screen output is suppressed.

Example 1:

1> FILENOTE Sonata "allegro non troppo"

attaches the filenote allegro non troppo to the Sonata file.

Example 2:

1> FILENOTE Toccata "*"presto*""

attaches the filenote "presto" to the Toccata file.

GET

Gets the value of a local variable.

Format

GET <name>

Template

NAME/A

Location

Internal

GET is used to retrieve and display the value of a local environment variable. The value is displayed in the current window.

Local environment variables are only recognized by the Shell in which they are created or by any Shells created from a NEWSHELL command executed in the original Shell. If you open an additional Shell by opening the Shell icon or by using the Execute Command menu item, previously created local environment variables are not available.

Example:

1> GET editor
Extras:Tools/MEmacs

See also: SET

GETENV

Gets the value of a global variable.

Format

GETENV <name>

Template

NAME/A

Location

Internal

GETENV is used to retrieve and display the value of a global environment variable. The value is displayed in the current window. Global variables are stored in ENV: and are recognized by all Shells.

Example:

1> GETENV editor
Extras:Tools/MEmacs

See also: SETENV

ICONX

Note:

ICONX is used only as a default tool in a project icon and cannot be used as a Shell command.

Allows execution of a script file of AmigaDOS commands from an icon.

Format

ICONX

Template

(none)

Location

C:

To use ICONX, create or copy a project icon for the script. Open the icon's Information window and change the Default Tool of the icon to C:ICONX and select Save to store the changed .info file. The script can then be executed by double-clicking on the icon.

When the icon is opened, ICONX changes the current directory to the directory containing the project icon before executing the script. A console window can be opened on the Workbench screen if the script produces output.

Several Tool Types can be specified in the script icon. The WINDOW Tool Type provides an alternate window specification for the input/output window. By default, the window's specification is:

WINDOW=CON:0/50//80/IconX/AUTO/WAIT/CLOSE

The AUTO option opens a window only if there is output created by the script. If a window opens, the WAIT option forces it to remain open after the script terminates until you specifically close it. The CLOSE option gives the window a close gadget.

The WAIT Tool Type (not to be confused with the WAIT option of the WINDOW Tool Type) specifies the number of seconds the input/output window should remain open after the script terminates. If you use this option the default input/output window cannot be closed before the WAIT period has expired. There is also a DELAY Tool Type that works in very similar way, except that its parameter is in 1/50th of a second, instead of in seconds.

The STACK Tool Type specifies the number of bytes to use for stack during script execution. If this Tool Type is not provided, the default 4096 bytes is used.

Finally, the USERSHELL Tool Type runs the script file using the current Use Shell instead of the normal ROM Shell. You must specify USERSHELL=YES. User Shells are third party shells that you can purchase and install in your system to replace the standard Amiga Shell environment that comes with the operating system.

Extended selection passes files that have icons to the script. Their file names appear to the script as keywords. To use this facility, the .KEY keyword must appear at the start of the script. In this case, the AmigaDOS EXECUTE command is used to execute the script file.

See also: EXECUTE. For examples using the ICONX command, see Chapter 8.

IF

Evaluates conditional operations in script files.

Format

IF [NOT] [WARN | ERROR | FAIL] [<string> EQ| GT | GE <string>] [VAL] [EXISTS <filename>]

Template

NOT/S,WARN/S,ERROR/S,FAIL/S,EQ/K,GT/K,GE/K,VAL/S,EXISTS/K

Location

Internal

In a script file, IF, when its conditional is true, carries out all the subsequent commands until an ENDIF or ELSE command is found. IF must be used in conjunction with ENDIF, however, ELSE is optional. When the conditional is not true, execution skips directly to the ENDIF or to an ELSE. The conditions and commands in IF and ELSE blocks can span more than one line before their corresponding ENDIFs.

Nested Ifs jump to the matching ENDIF.

The additional keywords are as follows:

NOT

Reverses the interpretation of the result.

WARN

True if previous return code is greater than or equal to 5.

ERROR

True if previous return codes is greater than or equal to 10; only available if FAILAT is set to greater than 10.

FAIL

True if previous return code is greater than or equal to 20; only available if FAILAT is set to greater than 20.

<a> GT <b>

True if the test of a is greater than the text of b (disregarding case). Use NOT GT for less than.

<a> GE <b>

True if the text of a is greater than or equal to the text of b (disregarding case). Use NOT GE for less than or equal to.

Top Previous Next Chapter