This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathbackslash.lcdoc
More file actions
54 lines (38 loc) · 1.86 KB
/
backslash.lcdoc
File metadata and controls
54 lines (38 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Name: \
Type: keyword
Syntax: \
Summary:
The <character> <\> is used to break a <line> in a <script> for display,
while still having it treated as a single <statement>.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
answer "You've been waiting for" & numberOfMinutes & \
"minutes." with "Keep Waiting" or "Cancel"
Description:
If a line is too long to fit conveniently in the script window, use the
<\> <character> to break it into two (or more) <lines> for viewing.
A line that is split with <\> is shown in the <script editor> as more
than one <line>, but when it's <execute|executed>, it is treated as a
single <line> of code.
The script editor automatically indents continued lines, as shown in the
example above. A <\> character which is used within a <literal string>
does not break the line, because the <\> is treated as part of the
<quoted> <string> instead of being treated as a line continuation. For
example, the following <statement> causes a <compile error> because the
<\> <character> is inside the quotes:
answer "This is a test. This is only a test. \
Had this been an actual life..." with "OK" -- BAD EXAMPLE
The above bad example can be corrected by using
the <operator> to break up the long <string> :
answer "This is a test. This is only a test." \
"Had this been an actual life..." with "OK" -- good example
The string has been broken into two substrings, so the <\> <character>
is no longer within a <literal string>. This second example does not
cause an <error>.
References: error (glossary), operator (glossary),
script editor (glossary), statement (glossary), literal string (glossary),
execute (glossary), quoted (glossary), compile error (glossary),
character (keyword), string (keyword), line (keyword), lines (keyword),
; (keyword), && (operator), & (operator), script (property)