-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path1455.html
More file actions
190 lines (190 loc) · 12.7 KB
/
Copy path1455.html
File metadata and controls
190 lines (190 loc) · 12.7 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | TRUE</title>
<meta name="description" content="TRUE">
<link rel="canonical" href="1455">
<link rel="keywords" href="TRUE">
<link rel="stylesheet" href="/css/style.css">
<link rel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<script src="/clipboard.js"></script>
</head>
<body>
<button onclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<script src="/backtotop.js"></script>
<div class="wrapAll clearfix">
<nav class="navigation">
<div class="logo">
<a href="/"><img src='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<div class="navlinks">
<a href="/pages/download.html">Download</a>
<a href="/pages/news.html">News</a>
<a href="/pages/community.html">Community</a>
<a href="/pages/articles.html">Resources</a>
<a class='active' href="/pages/reference.html">Language Reference</a>
<a href="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsRight">
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/reference/1455-language-true.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/reference/1455-language-true.markdown">History</a>
</div>
</div>
<div class="article">
<h1>TRUE</h1>
<blockquote>TRUE</blockquote>
<div class="siteSub">
<p>
<a href="/">Home</a> >
<a href="/pages/reference.html">Reference</a> >
<a href="/pages/language.html">Language</a>
</p>
</div>
<p>Boolean TRUE.</p>
<h3 id="example-1-assign-true-to-a-variable">Example 1: Assign TRUE to a
variable</h3>
<div class="sourceCode" id="cb1"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>a = <span class="dt">true</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>b = <span class="dt">false</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> a <span class="co">' Output: 1</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> b <span class="co">' Output: 0</span></span></code></pre></div>
<h3 id="example-2-use-in-a-while-loop">Example 2: Use in a while
loop</h3>
<div class="sourceCode" id="cb2"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>IsRunning = <span class="dt">true</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a><span class="kw">while(</span>IsRunning)</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> i++</span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">print</span> i </span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">if(</span>i == <span class="dv">5</span>) <span class="kw">then Is</span>Running = <span class="dt">false</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="kw">wend</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a><span class="co">' Output: 1 2 3 4 5</span></span></code></pre></div>
<h3 id="example-3-use-in-a-if-statement">Example 3: Use in a if
statement</h3>
<div class="sourceCode" id="cb3"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>ButtonPressed = <span class="dt">true</span> <span class="co">' replace true with false</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="kw">if(</span>ButtonPressed) <span class="kw">then pr</span>int <span class="st">"Button was pressed"</span></span></code></pre></div>
<div class="lavenderBox">
<div class="header">Code samples using TRUE</div>
<div class="linklist">
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/getting started/003 conditional branching.bas">003 conditional branching.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/getting started/006 arrays+.bas">006 arrays+.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/100lines.bas">100lines.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/2048.bas">2048.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/utilities/agendus.bas">agendus.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/mathematics/bairstow.bas">bairstow.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/blackbox.bas">blackbox.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/Blackbox.bas">Blackbox.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/bopit.bas">bopit.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/applications/calc.bas">calc.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/checkers.bas">checkers.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/chess.bas">chess.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 1/conrec-sb-v01.bas">conrec-sb-v01.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 2/falling blocks - tetris.bas">falling blocks - tetris.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/gobble.bas">gobble.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/guessit.bas">guessit.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/hanoi.bas">hanoi.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/illuminati.bas">illuminati.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/code demos/image demo.bas">image demo.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/index.bas">index.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/mathematics/leastq.bas">leastq.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/matches.bas">matches.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/matches.bas">matches.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 2/maze generator.bas">maze generator.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/applications/memoryTest.bas">memoryTest.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/memorytest.bas">memorytest.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/system/new bas.bas">new bas.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/applications/palm_cli.bas">palm_cli.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/utilities/pdocview.bas">pdocview.bas </a>
</div>
</div>
<div class="lavenderBox">
<div class="header">Language</div>
<div class="linklist">
<a href="/reference/662.html">AND </a>
<a href="/reference/1424.html">AS </a>
<a href="/reference/663.html">BAND </a>
<a href="/reference/1428.html">BG </a>
<a href="/reference/664.html">BOR </a>
<a href="/reference/639.html">BYREF </a>
<a href="/reference/637.html">CALL </a>
<a href="/reference/640.html">CASE </a>
<a href="/reference/1426.html">CATCH </a>
<a href="/reference/678.html">CONST </a>
<a href="/reference/1419.html">DECLARE </a>
<a href="/reference/641.html">DEF </a>
<a href="/reference/642.html">DO </a>
<a href="/reference/643.html">ELIF </a>
<a href="/reference/644.html">ELSE </a>
<a href="/reference/645.html">ELSEIF </a>
<a href="/reference/679.html">END </a>
<a href="/reference/1427.html">END TRY </a>
<a href="/reference/646.html">ENDIF </a>
<a href="/reference/665.html">EQV </a>
<a href="/reference/648.html">EXIT </a>
<a href="/reference/1457.html">FALSE </a>
<a href="/reference/650.html">FI </a>
<a href="/reference/680.html">FOR </a>
<a href="/reference/651.html">FUNC </a>
<a href="/reference/681.html">GOSUB </a>
<a href="/reference/682.html">GOTO </a>
<a href="/reference/683.html">IF </a>
<a href="/reference/638.html">IFF </a>
<a href="/reference/666.html">IMP </a>
<a href="/reference/667.html">IN </a>
<a href="/reference/684.html">LABEL </a>
<a href="/reference/685.html">LET </a>
<a href="/reference/668.html">LIKE </a>
<a href="/reference/653.html">LOCAL </a>
<a href="/reference/1496.html">LSHIFT </a>
<a href="/reference/669.html">MDL </a>
<a href="/reference/670.html">MOD </a>
<a href="/reference/671.html">NAND </a>
<a href="/reference/654.html">NEXT </a>
<a href="/reference/672.html">NOR </a>
<a href="/reference/673.html">NOT </a>
<a href="/reference/686.html">ON </a>
<a href="/reference/674.html">OR </a>
<a href="/reference/688.html">REM </a>
<a href="/reference/689.html">REPEAT </a>
<a href="/reference/690.html">RETURN </a>
<a href="/reference/1497.html">RSHIFT </a>
<a href="/reference/655.html">SELECT </a>
<a href="/reference/1421.html">STEP </a>
<a href="/reference/656.html">STOP </a>
<a href="/reference/657.html">SUB </a>
<a href="/reference/658.html">THEN </a>
<a href="/reference/1437.html">THROW </a>
<a href="/reference/1420.html">TO </a>
<a href="/reference/1455.html"><strong>TRUE</strong> </a>
<a href="/reference/1425.html">TRY </a>
<a href="/reference/660.html">UNTIL </a>
<a href="/reference/661.html">USE </a>
<a href="/reference/1423.html">USG </a>
<a href="/reference/1422.html">USING </a>
<a href="/reference/691.html">WEND </a>
<a href="/reference/692.html">WHILE </a>
<a href="/reference/675.html">XNOR </a>
<a href="/reference/676.html">XOR </a>
</div>
</div>
</div>
<div class="pagefooter">
This page was last edited on Tue, 5 Sep 2023 14:25:55 +0200
|
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
</div>
</div>
</div>
</body>
</html>