Microsoft Small Basic
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

If Then

RSS
Modified on 2010/06/04 18:56 by 174.52.213.128 Categorized as Uncategorized
Sometimes in recipes you'll see 'If .... Then' instructions. Such as the following
'    If the current height is greater than 55 then 
'        drawFlatRoof (recipe below)

This means that if the current height is greater than 55 then we should draw a flat roof.

'    If the current height is greater than 55 then 
     If currentHeight > 55 Then

'        drawFlatRoof (recipe below)
         drawFlatRoof()


Sometimes recipes won't tell you, but every 'If .... Then' needs an 'EndIf'. We know where to put the 'EndIf' by when the instructions below the 'If ....' stop being indented

'    If the current height is greater than 55 then 
     If currentHeight > 55 Then

' >>>>   drawFlatRoof (recipe below)
         drawFlatRoof()
     
' << (more recipe instructions would be like this)


So we put the 'EndIf' before the (more recipe instructions because that's where the indenting stops

'    If the current height is greater than 55 then 
     If currentHeight > 55 Then

' >>>>   drawFlatRoof (recipe below)
         drawFlatRoof()
     EndIf 

' << (more recipe instructions would be like this)

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.