-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
182 lines (182 loc) · 11.6 KB
/
index.html
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
<!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 | one more basic</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/index.html">
<link rel="keywords" href="index">
<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>
<div class="wrapAll clearfix">
<div class="sidebar">
<div class="logo">
<a href="/"><img src='/images/sb-desktop-128x128.png' alt="logo"></a>
</div>
<div class="navigation">
<h4>SmallBASIC</h4>
<ul>
<li><a href="/">Main page</a></li>
<li><a href="/pages/download.html">Download</a></li>
<li><a href="/pages/reference.html">Language reference</a></li>
<li><a href="/pages/samples.html">Code library</a></li>
</ul>
<hr class="menuSeparator"/>
<ul>
<li><a href="/pages/news.html">News</a></li>
<li><a href="/pages/articles.html">Articles</a></li>
<li><a href="/pages/community.html">Community</a></li>
<li><a href="/pages/changelog.html">Changelog</a></li>
<li><a href="/pages/screenshots.html">Screenshots</a></li>
<li><a href="/pages/links.html">Links</a></li>
</ul>
</div>
</div>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsLeft">
<ul>
<li><a href="#" class="active">Article</a></li>
<li><a href="https://www.syntaxbomb.com/smallbasic">Discuss</a></li>
</ul>
</div>
<div id="simpleSearch">
<form action="https://github.com/smallbasic/smallbasic.github.io/search"
target="_github" accept-charset="UTF-8" method="get" style="display:inline">
<div id="submitSearch">
<button type="submit"> </button>
<input type="hidden" class="js-site-search-type-field" name="type">
<input type="hidden" name="utf8" value="✓">
<input type="hidden" name="l" value="Visual Basic">
<input type="text" name="q" placeholder="Search" id="searchInput">
</div>
</form>
</div>
<div class="tabsRight">
<ul>
<li><a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/index.markdown">View source</a></li>
<li><a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/index.markdown">View history</a></li>
</ul>
</div>
</div>
<div class="article">
<h1 id="welcome-to-smallbasic">Welcome to SmallBASIC</h1>
<blockquote>
<p>one more basic</p>
</blockquote>
<p>SmallBASIC is a fast and easy to learn BASIC language interpreter
ideal for everyday calculations, scripts and prototypes. SmallBASIC
includes trigonometric, matrices and algebra functions, a built in IDE,
a powerful string library, system, sound, graphic commands and
communication via serial or sockets along with structured programming
syntax.</p>
<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="co">' Example for using functions in SmallBASIC</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>s = AddStrings(<span class="st">"My"</span>, <span class="st">"String"</span>)</span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> s</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">func </span>AddStrings(a, b)</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">return</span> a + b</span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span></code></pre></div>
<h2 id="programming-made-easy-for-all">Programming Made Easy for
All</h2>
<p>SmallBASIC is available for various operating systems, including
Windows, Linux, and Android. You can even build it from source to run on
many other POSIX-compliant systems, such as Raspberry Pi OS for the
Raspberry Pi. With its built-in Integrated Development Environment
(IDE), you can write programs on your Android-powered tablet or mobile
phone and run them instantly. If you want to get started, you can
download SmallBASIC from our (<a
href="/pages/download.html">Downloads</a>) page.</p>
<p>SmallBASIC makes it easy to bundle your program with all the
necessary libraries, creating executable files for Windows (exe-files)
or Linux (AppImage). For Android, you can create a signed package (pkg)
and distribute it through platforms like Google Play. Learn more about
distributing your program on our (<a
href="/pages/distributiontool.html">Distribution</a>) page.</p>
<p>If you prefer an online experience, you can start programming with
the web-based version of SmallBASIC in your browser right now. Just
click on <a href="/online/sbasic.html">Start online</a> to begin
coding.</p>
<h2 id="editors-ide-and-smallbasic-versions">Editors, IDE and SmallBASIC
versions</h2>
<p>SmallBASIC comes in three different flavors for the desktop. The SDL
version offers a simple but efficient IDE and is perfect for working
with graphics. The FLTK version has a great IDE. The console version
doesn’t offer an IDE and is text-only but works perfect with plugins
like raylib or nuklear (<a
href="/pages/download.html">Downloads</a>).</p>
<p>No matter which SmallBASIC version you prefer, external editors like
Visual Studio Code, Geany, Sublime Text or KDE Kate can be setup for
syntax highlighting or code execution (<a
href="/pages/language_support.html">Setup external editors</a>).</p>
<p>Instructions on how to use the editor in the SDL and Android version
can be found in the article <a
href="/pages/android.html">Android</a></p>
<h2 id="units">Units</h2>
<p>Units are sets of functions, procedures and constants bundled in a
BASIC-library and can be imported in your program. Units use their own
namespace and therefore are separated from your program.</p>
<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><span class="co">' Example for importing the CSS color-name unit</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="pp">Import</span> crgb <span class="kw">as</span> c</span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="fu">Color</span> c.Black, c.Tomato</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a><span class="kw">Print</span> <span class="st">" Standard CSS Tomato background color "</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="fu">Color</span> c.Black, c.LightSteelBlue</span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="kw">Print</span> <span class="st">" Standard CSS LightSteelBlue background color "</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a><span class="fu">rect</span> <span class="dv">200</span>, <span class="dv">200</span>, <span class="dv">400</span>, <span class="dv">400</span> <span class="fu">COLOR</span> c.DeepPink filled</span></code></pre></div>
<h2 id="plugins">Plugins</h2>
<p>Plugins are libraries written in C which extent the functionality of
SmallBASIC. SmallBASIC offers an API to write your own plugins. The
following plugins are part of the release version of SmallBASIC: raylib
(2D and 3D game development), nuklear (GUI programming), clipboard,
gifencoder and WebSockets. You can also import a plugin for the
Raspberry Pi to use the GPIO ports and some additional hardware like
displays or temperature sensors.</p>
<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><span class="co">' Example how to use raylib to open a window and print text.</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="pp">import</span> raylib <span class="kw">as</span> rl</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="pp">import</span> raylibc <span class="kw">as</span> c</span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> screenWidth = <span class="dv">800</span></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a><span class="dt">const</span> screenHeight = <span class="dv">450</span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a>rl.InitWindow(screenWidth, screenHeight, <span class="st">"raylib [core] example - basic window"</span>)</span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a>rl.SetTargetFPS(<span class="dv">60</span>)</span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a><span class="kw">while </span>(!rl.WindowShouldClose())</span>
<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a> rl.BeginDrawing()</span>
<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a> rl.ClearBackground(c.RAYWHITE)</span>
<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a> rl.DrawText(<span class="st">"Congrats! You created your first window!"</span>, <span class="dv">190</span>, <span class="dv">200</span>, <span class="dv">20</span>, c.LIGHTGRAY)</span>
<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a> rl.EndDrawing()</span>
<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a><span class="kw">wend</span></span>
<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a>rl.CloseWindow()</span></code></pre></div>
<h2 id="more-information">More information</h2>
<p>Read more in the short <a href="/pages/guide.html">user guide</a> or
in the <a href="/pages/vade.html">SmallBASIC handbook</a>. See the
documentation of all SmallBASIC commands in the <a
href="/pages/reference.html">language reference</a> or browse additional
articles in the <a href="/pages/articles.html">article section</a>.</p>
</div>
<div class="pagefooter">
This page was last edited on Sun, 4 Aug 2024 12:02:48 +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.3</a>
| Template by <a href="http://html5-templates.com/" target="_blank" rel="nofollow">HTML5 Templates</a>
</div>
</div>
</div>
</body>
</html>