McIDAS-X Learning Guide
Version 2020

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]


String Tables - Listing, Creating and Using Strings

In this exercise, you will create several strings and run them.
  1. Start a McIDAS session.
    At the Unix prompt:
    Type:  mcidas
    Your session should still be set for twenty frames from the last time you edited the Configuration GUI. If not, set it for six frames, as described in Getting Started.
  2. 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.
     TL                                                    
     H           := 19:09:02                                 
     Y           := 2020231                                
       --END OF LIST                                       
    
  3. 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.

  4. Define a string called NOTE that stores a comment.
    Type:  TE NOTE "MAP OF THE WORLD
  5. Define a string called WORLDMAP that contains the command MAP WORL 3 BOX=NO.
    Type:  TE WORLDMAP "MAP WORL 3 BOX=NO
  6. 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.

  7. 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.

  8. Now list all of the strings in the current table, including the global strings.
    Type:  TL OUT
    ?CROSS should be included in the listing.

  9. Display a map by running the string called WORLDMAP.
    Type:  #WORLDMAP
    A map of the world is drawn on the frame.

  10. Change the cursor by running the CROSS string.
    Type:  #?CROSS
  11. 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.

  12. Erase frame 1.
    Type:  ERASE G 1
  13. 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                             
    
  14. 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.

  15. 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     
    
  16. 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                          
    	  
  17. 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.

  18. Define a string using the F4 function key.
    Type:  TE KEYF4 "ZA "USA
  19. Move the cursor and run the string called KEYF4. Move the cursor and run the command several times.
    Press:  F4

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]