-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path1521.html
More file actions
156 lines (156 loc) · 10.3 KB
/
Copy path1521.html
File metadata and controls
156 lines (156 loc) · 10.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
<!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 | COMMAND</title>
<meta name="description" content="SmallBASIC startup command line options.">
<link rel="canonical" href="1521">
<link rel="keywords" href="COMMAND">
<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/1521-system-command.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/reference/1521-system-command.markdown">History</a>
</div>
</div>
<div class="article">
<h1>COMMAND</h1>
<blockquote>s = COMMAND</blockquote>
<div class="siteSub">
<p>
<a href="/">Home</a> >
<a href="/pages/reference.html">Reference</a> >
<a href="/pages/system.html">System</a>
</p>
</div>
<p>Returns a string <code>s</code> containing the SmallBASIC startup
command line options.</p>
<h3 id="example-1-sdl-version-gui">Example 1: SDL version (GUI)</h3>
<p>Running the following line from the command line:</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>LINUX: sbasicg -r test.bas abc xyz fileName</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>WINDOWS: sbasicg.exe -r test.bas abc xyz fileName</span></code></pre></div>
<p>When “test.bas” is:</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="kw">PRINT</span> <span class="fu">COMMAND</span></span></code></pre></div>
<p>Will print “abc xyz fileName”</p>
<p>Note: When using the paramter <code>-r</code> in the above shown
example, sbasicg will from now on always start the programm. If you
want, that sbasicg starts again in edit-mode, please use the parameter
<code>-e</code></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>LINUX: sbasicg -e test.bas</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>WINDOWS: sbasicg.exe -e test.bas</span></code></pre></div>
<h3 id="example-2-non-graphical-console-version-cygwin-or-linux">Example
2: Non-graphical console version (cygwin or linux)</h3>
<p>Running the following line from the command line:</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>LINUX: sbasic test.bas abc xyz fileName</span>
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>WINDOWS: sbasic.exe test.bas abc xyz fileName</span></code></pre></div>
<p>When “test.bas” is:</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="kw">PRINT</span> <span class="fu">COMMAND</span></span></code></pre></div>
<p>Will print “abc xyz fileName”</p>
<h3 id="example-3-use-split-to-separate-parameters">Example 3: Use SPLIT
to separate parameters</h3>
<div class="sourceCode" id="cb6"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>LINUX: sbasicg -r test.bas abc xyz fileName</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a>WINDOWS: sbasicg.exe -r test.bas abc xyz fileName</span></code></pre></div>
<p>When “test.bas” is:</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>s = <span class="fu">COMMAND</span>()</span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a>split s, <span class="st">" "</span>, parameters</span>
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-5"><a href="#cb7-5" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="st">"First parameter : "</span>; parameters[<span class="dv">0</span>]</span>
<span id="cb7-6"><a href="#cb7-6" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="st">"Second parameter: "</span>; parameters[<span class="dv">1</span>]</span>
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="st">"Third parameter : "</span>; parameters[<span class="dv">2</span>]</span>
<span id="cb7-8"><a href="#cb7-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb7-9"><a href="#cb7-9" aria-hidden="true" tabindex="-1"></a><span class="co">' Output:</span></span>
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a><span class="co">' First parameter : abc</span></span>
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a><span class="co">' Second parameter: xyz</span></span>
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a><span class="co">' Third parameter : fileName </span></span></code></pre></div>
<div class="lavenderBox">
<div class="header">Code samples using COMMAND</div>
<div class="linklist">
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/dogstar5.bas">dogstar5.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/network/irc-bot.bas">irc-bot.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/applications/loadsavebmp.bas">loadsavebmp.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/system/palmcli.bas">palmcli.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/utilities/pdocview.bas">pdocview.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 4/PRINTA_OKOK.bas">PRINTA_OKOK.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/startrek.bas">startrek.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/startrek.bas">startrek.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/units/strlib.bas">strlib.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/applications/TinyBASIC.bas">TinyBASIC.bas </a>
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/gp utm package/zacalc.bas">zacalc.bas </a>
</div>
</div>
<div class="lavenderBox">
<div class="header">System</div>
<div class="linklist">
<a href="/reference/1439.html">CHAIN </a>
<a href="/reference/1521.html"><strong>COMMAND</strong> </a>
<a href="/reference/1522.html">CWD </a>
<a href="/reference/806.html">DELAY </a>
<a href="/reference/807.html">ENV </a>
<a href="/reference/815.html">ENV </a>
<a href="/reference/1443.html">EXEC </a>
<a href="/reference/1440.html">EXPORT </a>
<a href="/reference/606.html">FRE </a>
<a href="/reference/1525.html">HOME </a>
<a href="/reference/1441.html">IMPORT </a>
<a href="/reference/1462.html">INCLUDE </a>
<a href="/reference/1736.html">MAXINT </a>
<a href="/reference/1735.html">NIL </a>
<a href="/reference/1442.html">OPTION </a>
<a href="/reference/809.html">PAUSE </a>
<a href="/reference/1524.html">PI </a>
<a href="/reference/817.html">PROGLINE </a>
<a href="/reference/810.html">RANDOMIZE </a>
<a href="/reference/818.html">RUN </a>
<a href="/reference/1523.html">SBVER </a>
<a href="/reference/1734.html">SELF </a>
<a href="/reference/812.html">STKDUMP </a>
<a href="/reference/813.html">TROFF </a>
<a href="/reference/814.html">TRON </a>
<a href="/reference/1446.html">UNIT </a>
</div>
</div>
</div>
<div class="pagefooter">
This page was last edited on Tue, 30 May 2023 09:23:02 +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>