10.1 String Tables - Listing, Creating and Using Strings
In this exercise, you will create several strings and run them.
- Start a McIDAS session.
- At the Unix prompt:
- Type: mcidas
Your session should still be set for six frames
from the last time you edited your .mcidasrc file.
If not, set it for six frames, as described in
Getting Started.
- Log on and initialize the workstation.
- Type: LOGON initials project# I
- List the strings in the string table.
- Type: TL
TL without any parameters lists
the first 20 strings that begin with a letter or number.
The string table contains the H and Y system strings, which
contain the current date and time, as shown in the example below.
When you logged on with the I option, the string table was cleared.
TL
H := 19:09:02
Y := 1999362
--END OF LIST
- Position the cursor in the center of the frame and run the Y
string with the ZA command to print the
date on frame 1.
- Type: PC C;ZA "#Y
Notice that the string is expanded in the text window; the current
Julian date (ccyyddd) replaces #Y.
- Define a string called NOTE that stores a comment.
- Type: TE NOTE "MAP OF THE WORLD
- Define a string called WORLDMAP that contains the command
MAP WORL 3 BOX=NO.
- Type: TE WORLDMAP "MAP WORL 3 BOX=NO
- Define a global string called CROSS to create a green cross-hair cursor.
- Type: TE ?CROSS "CUR 51 51 XBOX GREEN
A string whose first character is a question mark (?) is defined as
global. Global strings remain in the table unless deleted explicitly
with TD ALL GLOB.
- List the strings in the string table and erase frame 1.
- Type: TL;ERASE G 1
The string table now contains four strings: H, NOTE, WORLDMAP, and Y, as
shown below.
TL
H := 19:16:43
NOTE := MAP OF THE WORLD
WORLDMAP := MAP WORL 3 BOX=NO
Y := 1999362
--END OF LIST
Note that the global string ?CROSS did not get listed.
- Now list all of the strings in the current table, including the global strings.
- Type: TL OUT
?CROSS should be included in the listing.
- Display a map by running the string called WORLDMAP.
- Type: #WORLDMAP
A map of the world is drawn on the frame.
- Change the cursor by running the CROSS string.
- Type: #?CROSS
- Position the cursor at TV line 15 and element 260 and use
the string NOTE with the ZA command
to print text on the screen.
- Type: PC T 15 260;ZA "#NOTE
The text MAP OF THE WORLD is printed on the screen.
- Erase frame 1.
- Type: ERASE G 1
- Define a string name T to print the current time. Remember that
the ZA command requires a double quote before text to be printed.
- Type: TE T "ZA "#H
Notice the expanded string in the text window. The system time
when the string was created (HH:MM:SS) replaces the #H as shown below.
T := ZA "20:12:07
- Run the string called T. Move the cursor and run the command
several times. Because the string name is a single letter, you can
press Ctrl and the letter to run the string.
- Press: Ctrl T
The time is drawn on the screen. Notice that it is the same
each time the string is run.
- Define the string CT so that the time updates to the current
time each time the string is run. The double pound signs indicate
that the value of string H should not be replaced until string
CT is executed.
- Type: TE CT "ZA "##H
Notice the expanded string in the text window as shown below.
CT := ZA "#H
- List the strings in the string table and notice the difference
between T and CT.
- Type: TL
The #H string is expanded in the T string and not in the CT string.
TL
CT := ZA "#H
H := 20:42:30
NOTE := MAP OF THE WORLD
T := ZA "20:12:07
WORLDMAP := MAP WORL 3 BOX=NO
Y := 1999362
--END OF LIST
- Move the cursor and run the string called CT. Move the cursor
and run the command several times.
- Type: #CT
The time is drawn on the screen; it is updated each time the string
is run.
- Define a string using the F4 function key.
- Type: TE KEYF4 "ZA "USA
- Move the cursor and run the string called KEYF4. Move the cursor
and run the command several times.
- Press: F4