Small Basic - Control Statements (featured article)
Published Feb 12 2019 02:29 PM 639 Views
Microsoft
First published on MSDN on Aug 10, 2013

Authored by Ed Price


Check out another great article from Nonki:


Small Basic: Control Statements




Here's an excerpt from it:



If statement


If statement or If clause is for making conditional branch.  If you'd like to show "AM" or "PM" by checking clock, following code and chart are for that.  There is another keyword "ElseIf" for this clause.  For detail about "ElseIf", see the next section.



' Start

hour = Clock . Hour ' Get hour

If hour < 12 Then ' hour < 12?

TextWindow . WriteLine ( "AM" ) ' Yes: Write "AM"

Else

TextWindow . WriteLine ( "PM" ) ' No: Write "PM"

EndIf

' End




============================




And check out the full article here:


Small Basic: Control Statements




Enjoy!


- Ninja Ed

Version history
Last update:
‎Feb 12 2019 02:29 PM
Updated by: