dcl_symbols
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dcl_symbols [2018/10/03 22:49] – tweaks lricker | dcl_symbols [2018/12/03 19:28] (current) – lricker | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== DCL Symbols ===== | ===== DCL Symbols ===== | ||
- | The term "// | + | The term "// |
Shell variables are very useful, in scripts and on the command line itself, and DCL variables are just as useful for the same purposes. | Shell variables are very useful, in scripts and on the command line itself, and DCL variables are just as useful for the same purposes. | ||
Line 17: | Line 17: | ||
A DCL symbol can be used as a **command alias** -- the global variable' | A DCL symbol can be used as a **command alias** -- the global variable' | ||
- | | + | < |
- | $ ls com: | + | $ ls == " |
- | + | $ ls com: | |
- | Directory DSA2: | + | |
- | + | Directory DSA2: | |
- | BELL.COM; | + | |
- | ... | + | BELL.COM; |
- | BUILD.COM; | + | ... |
- | CD.COM; | + | BUILD.COM; |
- | CLS.COM; | + | CD.COM; |
- | ... | + | CLS.COM; |
- | + | ... | |
- | Total of 37 files, 247 blocks. | + | |
+ | Total of 37 files, 247 blocks. | ||
+ | </ | ||
A DCL variable can be used as a **counter** -- this example might be found in a command file (script): | A DCL variable can be used as a **counter** -- this example might be found in a command file (script): | ||
- | | + | < |
- | $LOOP: | + | $ count = 0 ! create and initialize |
- | $ IF count .gt. 10 THEN GOTO LOOP_EXIT | + | $LOOP: |
- | $ WRITE sys$output "Loop iteration: ", count | + | $ IF count .gt. 10 THEN GOTO LOOP_EXIT |
- | $ count = count + 1 | + | $ WRITE sys$output "Loop iteration: ", count |
- | $ GOTO LOOP | + | $ count = count + 1 |
- | $LOOP_EXIT: | + | $ GOTO LOOP |
- | $ EXIT 1 | + | $LOOP_EXIT: |
+ | $ EXIT 1 | ||
+ | </ | ||
**Message strings** can be built-up (concatenated) using string variables: | **Message strings** can be built-up (concatenated) using string variables: | ||
- | | + | < |
- | $ Sister | + | $ Brother == " |
- | $ WRITE sys$output Sister, " & ", Brother, " are siblings." | + | $ Sister |
- | Jane & John are siblings. | + | $ WRITE sys$output Sister, " & ", Brother, " are siblings." |
- | $ DELETE /SYMBOL /GLOBAL Sister | + | Jane & John are siblings. |
- | $ DELETE /SYMBOL /GLOBAL Brother | + | $ DELETE /SYMBOL /GLOBAL Sister |
+ | $ DELETE /SYMBOL /GLOBAL Brother | ||
+ | </ | ||
These examples only scratch the surface of what's possible with DCL variables. | These examples only scratch the surface of what's possible with DCL variables. |
dcl_symbols.txt · Last modified: 2018/12/03 19:28 by lricker