-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path538.html
More file actions
172 lines (172 loc) · 11.3 KB
/
Copy path538.html
File metadata and controls
172 lines (172 loc) · 11.3 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
<!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 | CAT</title>
<meta name="description" content="Returns a console code. 0 = reset, 1 = bold, -1 bold-off, 2 = underline, -2 = underline-off, 3 = reverse, -3 = reverse-off.">
<link rel="canonical" href="538">
<link rel="keywords" href="CAT (x)">
<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/538-console-cat.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/reference/538-console-cat.markdown">History</a>
</div>
</div>
<div class="article">
<h1>CAT</h1>
<blockquote>s = CAT (x)</blockquote>
<div class="siteSub">
<p>
<a href="/">Home</a> >
<a href="/pages/reference.html">Reference</a> >
<a href="/pages/console.html">Console</a>
</p>
</div>
<p>Returns an escape code to format a string. The values of
<code>x</code> are listed in the following table:</p>
<table>
<thead>
<tr class="header">
<th style="text-align: right;">x</th>
<th>format</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">0</td>
<td>reset</td>
</tr>
<tr class="even">
<td style="text-align: right;">1</td>
<td>bold</td>
</tr>
<tr class="odd">
<td style="text-align: right;">-1</td>
<td>bold off</td>
</tr>
<tr class="even">
<td style="text-align: right;">2</td>
<td>underline</td>
</tr>
<tr class="odd">
<td style="text-align: right;">-2</td>
<td>underline off</td>
</tr>
<tr class="even">
<td style="text-align: right;">3</td>
<td>reverse</td>
</tr>
<tr class="odd">
<td style="text-align: right;">-3</td>
<td>reverse off</td>
</tr>
</tbody>
</table>
<p>For more information about escape codes please see the article
“Escape codes”.</p>
<h3 id="example">Example</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><span class="fu">Color</span> <span class="dv">14</span>, <span class="dv">1</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">Cat</span>(<span class="dv">1</span>); <span class="st">"This is Bold text"</span>; <span class="fu">Cat</span>(-<span class="dv">1</span>)</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">Cat</span>(<span class="dv">2</span>); <span class="st">"This is Underline text"</span>; <span class="fu">Cat</span>(-<span class="dv">2</span>)</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">Cat</span>(<span class="dv">3</span>); <span class="st">"This is Reverse text"</span>; <span class="fu">Cat</span>(-<span class="dv">3</span>)</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> </span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="co">' Cat(0) resets ALL attributes, including colors.</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">Cat</span>(<span class="dv">1</span>); <span class="fu">Cat</span>(<span class="dv">2</span>); <span class="st">"This is Bold & Underline text"</span>; <span class="fu">Cat</span>(<span class="dv">0</span>) </span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">Cat</span>(<span class="dv">2</span>); <span class="fu">Cat</span>(<span class="dv">3</span>); <span class="st">"This is Underline & Reverse text (with default colors)"</span>; <span class="fu">Cat</span>(<span class="dv">0</span>)</span></code></pre></div>
<div class="lavenderBox">
<div class="header">Code samples using CAT</div>
<div class="linklist">
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/getting started/000 hello.bas">000 hello.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/getting started/002 numeric variables.bas">002 numeric variables.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 2/3d rotating cube with message.bas">3d rotating cube with message.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/Other graphics/3d wire cube v1.bas">3d wire cube v1.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/3dtictac.bas">3dtictac.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/3dttt.bas">3dttt.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/mobile/3dttt.bas">3dttt.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/7gables.bas">7gables.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/mechanics/amortig.bas">amortig.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/anball 1.0.bas">anball 1.0.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/network/anomail.bas">anomail.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/mathematics/another look at trig functions.bas">another look at trig functions.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/BestOf Graphics/B+B.bas">B+B.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/units/base64.bas">base64.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/BestOf Graphics/bb2fork smurf.bas">bb2fork smurf.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/betrayal: crows ii.bas">betrayal: crows ii.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/graphics 4/block.bas">block.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 2/blushing snowflakes.bas">blushing snowflakes.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/bolmo.bas">bolmo.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 3/bomb.bas">bomb.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/Other graphics/bpf1.bas">bpf1.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/Other graphics/bpf2.bas">bpf2.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/misc/Peter Graphics/bubbles and triangles.bas">bubbles and triangles.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 2/bulls and cows.bas">bulls and cows.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/applications/Calendar.bas">Calendar.bas </a>
</div>
</div>
<div class="lavenderBox">
<div class="header">Console</div>
<div class="linklist">
<a href="/reference/521.html">AT </a>
<a href="/reference/522.html">BEEP </a>
<a href="/reference/538.html"><strong>CAT</strong> </a>
<a href="/reference/524.html">CLS </a>
<a href="/reference/1015.html">DEFINEKEY </a>
<a href="/reference/525.html">FORM </a>
<a href="/reference/539.html">INKEY </a>
<a href="/reference/527.html">INPUT </a>
<a href="/reference/528.html">LINEINPUT </a>
<a href="/reference/529.html">LINPUT </a>
<a href="/reference/530.html">LOCATE </a>
<a href="/reference/531.html">LOGPRINT </a>
<a href="/reference/532.html">NOSOUND </a>
<a href="/reference/533.html">PEN </a>
<a href="/reference/534.html">PLAY </a>
<a href="/reference/535.html">PRINT </a>
<a href="/reference/536.html">SOUND </a>
<a href="/reference/540.html">TAB </a>
</div>
</div>
</div>
<div class="pagefooter">
This page was last edited on Mon, 19 May 2025 20:22:52 +0930
|
<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>