/sys$common/syshlp/helplib.hlb Symbol Assign, String Assign, Examples *Conan The Librarian (sorry for the slow response - running on an old VAX) |
1. $ TIME := SHOW TIME $ TIME 15-APR-1987 11:55:44 The symbol TIME is equated to the command string SHOW TIME. Because the symbol name appears as the first word in a command string, the command interpreter automatically substitutes it with its string value and executes the command SHOW TIME. 2. $ STAT := $DBA1:[CRAMER]STAT $ STAT This example shows how to define STAT as a foreign command. The symbol STAT is equated to a string that begins with a dollar sign followed by a file specification. The command interpreter assumes that the file specification is that of an executable image, that is, a file with a file type of EXE. Thus, the symbol STAT in this example becomes a synonym for the command: $ RUN DBA1:[CRAMER]STAT.EXE When you subsequently type STAT, the command interpreter executes the image. 3. $ A = "this is a big space." $ SHOW SYMBOL A A = "this is a big space." $ B := 'A' $ SHOW SYMBOL B B = "THIS IS A BIG SPACE." This example compares the assignment and the string assignment statements. The symbol A is defined using the assignment statement, so lowercase letters and multiple spaces are retained. The symbol B is defined using the string assignment statement. Note that the apostrophes are required; otherwise, the symbol name B would have been equated to the literal string A. However, when symbol A's value is assigned to symbol B, the letters are converted to uppercase and multiple spaces are compressed.
|