Category:Palo Alto Tiny BASIC: Difference between revisions

→‎Features: RND; separating print items; setting widths of print items.
(Created page with "{{language|Palo Alto Tiny BASIC |tags=tinybasic}} {{implementation|BASIC}} '''Palo Alto Tiny BASIC''' is one of the most popular of the many versions of Tiny BASIC. It was developed in 1975 by Li-Chen Wang. ==Features== Palo Alto Tiny BASIC has some features that distinguish it from other Tiny BASICs: * The <code>FOR</code>...<code>NEXT</code> loop. Like in Microsoft BASIC, the upper and lower bounds of the loop are set on loop entry, and did not change during...")
 
(→‎Features: RND; separating print items; setting widths of print items.)
 
(2 intermediate revisions by the same user not shown)
Line 12:
* The statement <code>STOP</code> in addition to <code>END</code>.
* The use of <code>#</code> for not-equals in comparisons, as opposed to <code><></code>.
* The ability to set more than one variable in a single <code>LET</code> command: <syntaxhighlight lang="basic">LET A=1,B=0,A=A+2</syntaxhighlight>The word <code>LET</code> in a <code>LET</code> command can be omitted.
* Lack of <code>THEN</code> in an <code>IF</code> command.
* Numeric results of compare operations: 1 (if true), 0 (if false). Thus, one can use them in arithmetic expression. Note: <syntaxhighlight lang="basic">LET A=B=0</syntaxhighlight> means "set <code>A</code> to the result of comparing <code>B</code> with 0".
* A prompt in an <code>INPUT</code> command. If the prompt is omitted, the default is a name of the variable. E.g. <syntaxhighlight lang="basic">INPUT "WHAT IS THE HEIGHT"H</syntaxhighlight> will print <code>WHAT IS THE HEIGHT:</code> and wait to read an expression from the input device.<syntaxhighlight lang="basic">INPUT H</syntaxhighlight> will print <code>H:</code> and so on.
* The function <code>RND(X)</code> that returns a random number between 1 and X (inclusive).
* Separating print items with <code>,</code> (comma).
* Setting widths of numeric print items. A number preceeded by <code>#</code> sets the width (6 by default) of following numeric print items. It does not count leading spaces. For example,
<syntaxhighlight lang="basic">
10 PRINT "X",#2,1,10,"X"
20 PRINT 1,#4,10,20,#2,30,40
</syntaxhighlight>
displays
<pre>
X 1 10X
1 10 20 30 40
</pre>
 
==Implementations==
Line 22 ⟶ 38:
==External links==
* Wikipedia has [[wp:Tiny BASIC#Palo Alto Tiny BASIC|a section about Palo Alto Tiny BASIC]] in the [[wp:Tiny BASIC|Tiny BASIC]] entry.
* [http://www.devili.iki.fi/pub/IBM/PC/languages/ TINY BASIC, version 1.1 for Intel 8086] version of Palo Alto Tiny BASIC (exe, doc, and assembler source code included). For unclear reasons, it does not allow <code>S</code> to be a name of variable.
* [https://tinybc.sourceforge.net/ Tiny BASIC for Curses] - a superset of Palo Alto Tiny BASIC, but with little differences in syntax.
* [http://www.bitsavers.org/pdf/interfaceAge/197612/092-108.pdf ''Dr. Wang's Palo Alto Tiny BASIC'' by Roger Rauskolb] (manual in PDF).
511

edits