Quantcast
Channel: Small Basic
Viewing all articles
Browse latest Browse all 669

Small Basic - Control Statements (featured article)

$
0
0

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


Viewing all articles
Browse latest Browse all 669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>