5
bewerkingen
(De pagina SmallBasic toevoegen) |
(Pagina verder afmaken) |
||
<syntaxhighlight lang="vbnet">
TextWindow.Write("Hello World")
</syntaxhighlight>
of:
<syntaxhighlight lang="vbnet">
TextWindow.WriteLine("Hello World")
</syntaxhighlight>
Het eerste programma is anders dan het tweede programma, het tweede programma print 'Hello World' op een nieuwe regel. De eerste doet dat niet.
De eerste BASIC talen (waaronder QBasic) hebben een simpelere Syntax:
<syntaxhighlight lang="vbnet">
print "Hello World"
</syntaxhighlight>
SmallBasic is ook Turing Compleet.
===Conditional Branching===
<syntaxhighlight lang="vbnet">
TextWindow.Write("Enter the temperature today (in F): ")
temp = TextWindow.ReadNumber()
If temp > 100 Then
TextWindow.WriteLine("It is pretty hot.")
ElseIf temp > 70 Then
TextWindow.WriteLine("It is pretty nice.")
ElseIf temp > 50 Then
TextWindow.WriteLine("Don't forget your coat.")
Else
TextWindow.WriteLine("Stay home.")
EndIf
</syntaxhighlight>
|
bewerkingen