forked from verhas/jScriptBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.html
More file actions
139 lines (102 loc) · 8.2 KB
/
Copy pathbasic.html
File metadata and controls
139 lines (102 loc) · 8.2 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at Jan 17, 2013
| Rendered using Apache Maven Fluido Skin 1.2.1
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>jScriptBasic - jScriptBasic Project Documentation</title>
<link rel="stylesheet" href="./css/apache-maven-fluido.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido.min.js"></script>
<meta name="author" content="Peter Verhas" />
<meta name="Date-Creation-yyyymmdd" content="20120811" />
<meta name="Date-Revision-yyyymmdd" content="20130117" />
<meta http-equiv="Content-Language" content="en" />
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="http://scriptbasic.com" id="bannerLeft">
<img src="" alt="ScriptBasic for Java"/>
</a>
</div>
<div class="pull-right"> </div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 2013-01-17</li>
<li class="divider">|</li> <li id="projectVersion">Version: 1.0.4-SNAPSHOT</li>
<li class="pull-right"> <a href="http://scriptbasic.com" class="externalLink" title="ScriptBasic">ScriptBasic</a>
</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span3">
<div class="well sidebar-nav">
<h3>Documentation for SB4J</h3>
<ul>
<li class="none">
<a href="intro.html" title="Introduction">Introduction</a>
</li>
<li class="none">
<a href="name.html" title="Name of the game">Name of the game</a>
</li>
<li class="none">
<a href="design.html" title="History and Design Goals">History and Design Goals</a>
</li>
<li class="none">
<strong>Basic Language Implemented</strong>
</li>
<li class="none">
<a href="install.html" title="Installation">Installation</a>
</li>
<li class="none">
<a href="advanced/index.html" title="Embedding API">Embedding API</a>
</li>
<li class="none">
<a href="configure.html" title="Configuration">Configuration</a>
</li>
</ul>
<h3>Project Documentation</h3>
<ul>
<li class="collapsed">
<a href="project-info.html" title="Project Information">Project Information</a>
</li>
<li class="collapsed">
<a href="project-reports.html" title="Project Reports">Project Reports</a>
</li>
</ul>
<hr class="divider" />
<div id="poweredBy">
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<div class="g-plusone" data-href="http://www.scriptbasic.com" data-size="tall" ></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span9" >
<div class="section"><h2>The BASIC language interpreted by ScriptBasic for Java<a name="The_BASIC_language_interpreted_by_ScriptBasic_for_Java"></a></h2><p>The language implemented byScriptBasic for Java is a simple BASIC language. There are only a very few commands implemented to keep the language simple, easy to learn. The following commands are implemented:</p><ul><li><a href="./basic/let.html">Variable assignment</a>, <tt>LET</tt> and expression with operators</li><li><tt>IF</tt>/<tt>THEN</tt>/<tt>ELSEIF</tt>/<tt>ELSE</tt>/<tt>ENDIF</tt> <a href="./basic/if.html">conditional commands</a></li><li><tt>SUB</tt>/<tt>CALL</tt>/<tt>RETURN</tt> <a href="./basic/sub.html">subroutine and call</a> using formal arguments and local variables</li><li><tt>FOR</tt>/<tt>TO</tt>/<tt>STEP</tt>/<tt>NEXT</tt> <a href="./basic/for.html">loop</a>, using integer or float loop variable. Default step is 1. Checked at the head of the loop</li><li><tt>WHILE</tt>/<tt>WEND</tt> <a href="./basic/while.html">loop</a></li><li><tt>PRINT</tt> command to <a href="./basic/print.html">send output</a> to the standard output stream</li><li><tt>GLOBAL</tt>/<tt>LOCAL</tt> <a href="./basic/global.html">variable declaration</a></li><li><tt>USE</tt>/<tt>METHOD</tt> <a href="./basic/method.html">declaration</a> to use Java methods and objects from the BASIC code<p>The operators implemented in the language are</p></li><li><tt>-</tt>, <tt>+</tt> and <tt>not</tt> unary operators.</li><li><tt>.</tt> (dot) to access Java object fields (1)</li><li><tt>^</tt> power operator (2)</li><li><tt>*</tt> multiply (3)</li><li><tt>/</tt> division (floating point) (3)</li><li><tt>%</tt> modulo calculation (3)</li><li><tt>div</tt> integer divide (3)</li><li><tt>+</tt> binary add operator, works on integer values, float values and concatenates strings (4)</li><li><tt>-</tt> binary minus (4)</li><li><tt>=</tt> equality,<tt> <</tt> 'less than', <tt>> </tt>'greater than', <tt>>=</tt> 'greater or equal', <tt><=</tt> 'less or equal', <tt> <> </tt>'not equal' operators that compares values (5)</li><li><tt>and</tt> logical (short circuit) and operator (6)</li><li><tt>or</tt> logical (short circuit) or operator (6)<p>The operators have the usual precedences, as listed at the end of the lines above. You can use <tt>(</tt> and <tt>)</tt> parentheses to change the order of the evaluation of the operations. You can also use the parenthesis to call declared Java methods and to call BASIC defined subroutines.</p><p><a href="./basic/arrays.html">Arrays</a> can be accessed using the <tt>[</tt> and <tt>]</tt> brackets. Multidimensional array indices are separated by <tt>,</tt> comma. There is no array of arrays.</p><p><a href="./basic/file.html">File handling</a> is available via an extension class. This extension class is not loaded by default. The embedding application should register this extension class. The command line version does register this class.</p></li></ul></div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row span16">Copyright © 2013
<a href="http://www.verhas.com">Verhas and Verhas Software Craftsmen</a>.
All Rights Reserved.
</div>
</div>
</footer>
</body>
</html>