symbol_substitution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
symbol_substitution [2018/11/20 16:22] – clarifications lricker | symbol_substitution [2018/11/20 18:36] – move "Literal Quotes in DCL Strings" to separate wiki article lricker | ||
---|---|---|---|
Line 105: | Line 105: | ||
==== Producing Quotes in Quotes ==== | ==== Producing Quotes in Quotes ==== | ||
- | What if you want to produce literal double-quote marks to be printed in a string of text? -- like: | + | What if you want to produce literal double-quote marks to be printed in a string of text? -- like this: |
< | < | ||
Line 111: | Line 111: | ||
</ | </ | ||
- | When you want a //literal __double__-quote mark// to appear in a literal | + | ...or surround some text with single quotes? -- like this: |
< | < | ||
- | $ WRITE sys$output "This is "" | + | This is ' |
- | | + | |
- | | + | |
</ | </ | ||
- | ...or: | + | These are pretty common use-cases -- See the wiki article [[Literal Quotes in DCL Strings]] |
- | < | + | |
- | $ DQUOTE = """" | + | |
- | $ WRITE sys$output "This is " + DQUOTE, " | + | |
- | $ ! This | + | |
- | $ ! | + | |
- | $ ! a single string | + | |
- | </ | + | |
- | + | ||
- | ...or: | + | |
- | < | + | |
- | $ DQUOTE = """" | + | |
- | $ message = "This is " + DQUOTE, " | + | |
- | $ ! This ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | + | |
- | $ ! | + | |
- | $ ! a single string variable for any purpose, including printing... | + | |
- | $ WRITE sys$output message | + | |
- | </ | + | |
- | + | ||
- | ...or even: | + | |
- | < | + | |
- | $ DQUOTE = """" | + | |
- | $ WRITE sys$output "This is ", DQUOTE, " | + | |
- | $ ! The WRITE ^^^^^^^^^^ | + | |
- | $ ! | + | |
- | $ ! | + | |
- | </ | + | |
- | + | ||
- | This suggests a similar way to produce a //literal __single__-quote mark (tick)// in text: | + | |
- | < | + | |
- | $ SQUOTE = "'" | + | |
- | $ WRITE sys$output "This is ", SQUOTE, " | + | |
- | </ | + | |
- | + | ||
- | ...or: | + | |
- | < | + | |
- | $ SQUOTE = "'" | + | |
- | $ WRITE sys$output "This is " + SQUOTE + " | + | |
- | </ | + | |
- | + | ||
- | ...both produce: | + | |
- | < | + | |
- | This is ' | + | |
- | </ | + | |
==== Command File Parameters P1 thru P8 ==== | ==== Command File Parameters P1 thru P8 ==== |
symbol_substitution.txt · Last modified: 2018/11/20 22:52 by lricker