Content deleted Content added
→Arrays: Added example |
m Open access bot: url-access updated in citation with #oabot. |
||
(32 intermediate revisions by 22 users not shown) | |||
Line 1:
{{One source|date=December 2023}}
{{see also|SOB (disambiguation)}}
'''Southampton BASIC System''' (SOBS} was a dialect of the [[BASIC]] programming language developed for and used on [[ICT 1900]] series computers in the late 60s and early 70s; it was implemented under the [[MINIMOP]] operating system at the [[University of Southampton]].<ref>▼
{{Use dmy dates|date=August 2021}}
{{cite web▼
▲'''Southampton BASIC System''' ('''SOBS
| last = Rees▼
| first = M.J.▼
| last2 = Oppenheimer
| first2 = A.W.
| title = SOBS
|
| publisher = Wiley InterScience
| date =
| volume = 7
| url = http://www3.interscience.wiley.com/journal/113444749/abstract?CRETRY=1&SRETRY=0▼
| issue = 5
| pages = 631–643
| archive-url = https://archive.today/20130105083634/http://www3.interscience.wiley.com/journal/113444749/abstract?CRETRY=1&SRETRY=0
| url-status = dead
| archive-date = 5 January 2013
| format =
| doi = 10.1002/spe.4380070508
| s2cid = 33989728
| url-access = subscription
}}</ref> and also ran under [[MAXIMOP]].
It was operated from a [[
== Language characteristics ==
Line 61 ⟶ 71:
|-
| <code>PRINT</code>
| Output to the
|-
| <code>READ ''var''...</code>
Line 78 ⟶ 88:
=== Variables ===
[[Variable (programming)|Variable]] names for numeric values were either a single letter, or a single letter followed by a single numeric digit, thus allowing for 286 discreet variables in total. Strings were supported; variable names for them had the same restriction but were followed by a pound (<code>
=== Functions ===
Line 116 ⟶ 126:
Support for strings was more limited, with only one function, <code>LEN</code>, which returned the length of the string parameter. Sub-strings were supported with square brackets, so <code>A£[2,3]</code> referred to the sub-string of the string <code>A£</code> from the 2nd character to the 3rd character inclusive, so
<syntaxhighlight lang="basic">
10 LET A£ = "FOO"▼
</syntaxhighlight>
would print <code>OO</code>
This syntax was also supported on the left-hand side of an assignment, so
<syntaxhighlight lang="basic">
▲ 30 PRINT A£
30 PRINT A£
</syntaxhighlight>
would print <code>FBARO</code>
=== Arrays ===
Support for handling arrays of data was relatively strong, with <code>MAT</code> statements able to read an entire array from <code>DATA</code> statements, and perform useful [[matrix (mathematics)|matrix]] operations such as
Example:
<syntaxhighlight lang="basic">
10 DATA 0,0,1,0,1,0,1,0,0▼
90 MAT D=INV(C)
100 MAT PRINT D,
<math>\begin{pmatrix}▼
</syntaxhighlight>
0 & 0 & 1 \\▼
{|
0 & 1 & 0 \\▼
|<code>A</code> is read from the first <code>DATA</code> statement
1 & 0 & 0▼
▲|<math>\begin{pmatrix}
1 & 1 & 2 \\
0 & 2 & 1
\end{pmatrix}</math>
|-
|<code>B</code> is read from the second <code>DATA</code> statement
|<math>\begin{pmatrix}
2 & 4 & 3 \\▼
0 & 1 &
\end{pmatrix}</math>
|-
|<code>C</code> is calculated by multiplying <code>A</code> and <code>B</code>
|<math>\begin{pmatrix}
▲ 1 & -4 & 5 \\
2 &
1 & 2 & 0
\end{pmatrix}</math>
|-
|<code>D</code> is calculated as the inverse of <code>C</code>
|<math>\begin{pmatrix}
4 & -3 & -2
\end{pmatrix}</math>
|}
The output would be
== Debugging ==
{{expand
SOBS had primitive debugging capabilities, limited mostly to the <code>TRACE</code> statement. <code>TRACE ON</code> would cause the interpreter to print each line number as it was executed.
Line 170 ⟶ 198:
{{Reflist}}
{{
{{DEFAULTSORT:Southampton Basic System}}
[[Category:BASIC interpreters]]
[[Category:ICL programming languages]]
[[Category:Science and technology in Hampshire]]
[[Category:University of Southampton]]
[[Category:BASIC programming language family]]
|