Programmeren in Small Basic: verschil tussen versies

Verwijderde inhoud Toegevoegde inhoud
Guest91111 (overleg | bijdragen)
De pagina SmallBasic toevoegen
 
Guest91111 (overleg | bijdragen)
Pagina verder afmaken
Regel 6:
<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>
Informatie afkomstig van https://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.