Table of contents Previous: String Tables Next: String Tables - Listing, Creating and Using Strings

10.0 String Tables - Basic Concepts

Creating Strings

Strings are created by assigning a string name to a character string with the TE or ASK1 command. A character string consists of alphanumeric and printable characters. When creating strings, keep in mind the following guidelines:

Using Strings

To run a string containing a command, you must type a pound key (#) followed by the string name. For example, to run the string DISPIMAGE, which contains the command IMGDISP GI4 4 LATLON=35 98, you would type #DISPIMAGE on the command line. To use a string containing part of a command, type the command and substitute #stringname at the appropriate position. For example, to use the string LL which contains the text 43:35:15 98:25:40, you could run the command IMGDISP GI4 1 LATLON=#LL.

Strings can be nested, allowing one string to use another string. For example, the string DISPIMAGE defined as IMGDISP GI4 1 LATLON=#LL has a nested string (LL). In the string table, #LL is expanded and DISPIMAGE is listed as IMGDISP GI4 1 LATLON=43:35:15 98:25:40. The nested string must be defined before it is used in another string.

If the string contains a value that will change, an additional pound sign allows the string to be expanded when it is run. For example, if LL will change, type a pound sign before LL so the string DISPIMAGE becomes IMGDISP GI4 1 LATLON=##LL. When the string DISPIMAGE is entered in the string table, it will appear as IMGDISP GI4 1 LATLON=#LL. When DISPIMAGE is run, the current value of LL is inserted.

You can also assign strings to a single letter. To run these strings, press the Ctrl key and the appropriate letter. Strings can also be assigned to the function keys (F keys) with an Alt, Shift, or Ctrl combination. This is useful if you enter certain commands often.

Using Global Strings

A string whose first character is a question mark (?) is called a global string. Global strings are useful for defining strings you don't want accidently deleted. They are not saved in user-defined string tables, but remain in the string table until you delete them.

Deleting Strings and Global Strings

The TD command deletes individual strings, strings with a common prefix, or all the strings in the string table. When you delete all the strings in the string table, two system strings (H and Y) and any global strings remain. Global strings are stored in the string table and will remain unless you delete them using TD ALL GLOB.

Some McIDAS commands write global strings to the string table. If you have problems using the string table, clear out your string table with the TD ALL GLOB command.

Saving and Restoring String Tables

Each McIDAS session has its own string table which stores strings until they are saved into a user-defined string table with the TU SAVE command. The project number and the initials of the user who created it are saved with each user-defined string table. A string table can contain up to 256 strings, a workstation can store up to 512 string tables. When a user-defined string table is restored with the TU REST command, a copy of the strings from the user-defined string table is written into the string table. When a string table is saved, any existing table with the same name and user initials is overwritten.

To restore a user-defined string table within a McIDAS session, specify its name and user initials with the TU REST command. You cannot delete another user's string tables. When a string table is restored, the default table is overwritten and unsaved strings are lost (except global strings).

Determining the Current String Table

The strings contained in the string table depend on how the McIDAS session was started. If a McIDAS session was started:

Incrementing String Values

The REPEAT command increments variables in a command by running it multiple times until a specific value is reached. For example, you can use the REPEAT command with a string containing the IMGDISP command to display images in multiple frames with one command.


Table of contents Previous: String Tables Next: String Tables - Listing, Creating and Using Strings