openvms:openvms-cheatsheet
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
openvms:openvms-cheatsheet [2023/07/01 07:45] – dodger | openvms:openvms-cheatsheet [2023/07/01 08:10] (current) – dodger | ||
---|---|---|---|
Line 36: | Line 36: | ||
| '' | | '' | ||
+ | ====== Programming ====== | ||
+ | More or less | ||
===== Symbols (Variables) | ===== Symbols (Variables) | ||
^ Creation ^ Description ^ | ^ Creation ^ Description ^ | ||
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | '' | + | | '' |
- | | '' | + | | '' |
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | ===== Aliases through symbols ===== | ||
+ | Create an alias '' | ||
+ | <code DCL> | ||
+ | EDT :== EDIT/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | Replace a command with the command you want: | ||
+ | <code DCL> | ||
+ | PRINT :== PRINT/ | ||
+ | </ | ||
+ | This will replace the command '' | ||
+ | |||
+ | ===== Operations with symbols ===== | ||
+ | |||
+ | ==== Arithmetic operations (integers) ==== | ||
+ | |||
+ | <code DCL> | ||
+ | $ APPLES = 10 | ||
+ | $ SHOW SYMBOL APPLES | ||
+ | APPLES = 10 Hex = 0000000A | ||
+ | |||
+ | $ APPLES = 2 * (4+5) | ||
+ | $ SHOW SYMBOL APPLES | ||
+ | APPLES = 18 Hex ... | ||
+ | $ ORANGES = 15 | ||
+ | $ TOTAL_FRUIT = APPLES + ORANGES | ||
+ | $ SHOW SYMBOL TOTAL_FRUIT | ||
+ | TOTAL_FRUIT = 33 | ||
+ | </ | ||
+ | |||
+ | === List of operations === | ||
+ | ^ Operation ^ | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | ''/'' | ||
+ | |||
+ | ==== String operations ==== | ||
+ | |||
+ | <code DCL> | ||
+ | $ APPLES = " | ||
+ | $ SHOW SYMBOL APPLES | ||
+ | APPLES = " | ||
+ | $ FRUIT = " | ||
+ | $ SHOW SYMBOL FRUIT | ||
+ | FRUIT = " | ||
+ | </ | ||
+ | |||
+ | ==== Using subshells in commands ==== | ||
+ | |||
+ | Sub-shell is invoqued with '' | ||
+ | <code DCL> | ||
+ | $ FILETYPE = " | ||
+ | $ TYPEIT = "TYPE '' | ||
+ | $ SHOW SYMBOL TYPEIT | ||
+ | "TYPE login.com" | ||
+ | </ | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | Take care with string usage '': | ||
+ | </ | ||
+ | What works and what not (as a sub-shell): | ||
+ | * Works: | ||
+ | <code DCL> | ||
+ | $ FILETYPE := " | ||
+ | $ TYPEIT := "TYPE '' | ||
+ | $ SHOW SYMBOL TYPEIT | ||
+ | "TYPE login.com" | ||
+ | </ | ||
+ | |||
+ | * DON'T Work (as a literal) | ||
+ | <code DCL> | ||
+ | $ FILETYPE := " | ||
+ | $ TYPEIT := " | ||
+ | $ SHOW SYMBOL TYPEIT | ||
+ | "TYPE FILENAME" | ||
+ | </ | ||
+ | <WRAP center round tip 60%> | ||
+ | In the other hand, without forcing string assignment | ||
+ | </ | ||
+ | Both are assigned as a variable: | ||
+ | <code DCL> | ||
+ | $ FILETYPE = " | ||
+ | $ TYPEIT = "TYPE '' | ||
+ | $ SHOW SYMBOL TYPEIT | ||
+ | "TYPE login.com" | ||
+ | </ | ||
+ | <code DCL> | ||
+ | $ FILETYPE = " | ||
+ | $ TYPEIT = " | ||
+ | $ SHOW SYMBOL TYPEIT | ||
+ | "TYPE login.com" | ||
+ | </ | ||
====== Startup ====== | ====== Startup ====== |
openvms/openvms-cheatsheet.1688197535.txt.gz · Last modified: 2023/07/01 07:45 by dodger