Example - Function Statement

  1. Sub Main

    1. Dim I as integer

      For I = 1 to 10

      1. Print GetColor2(I)

      Next I

    End Sub

 

  1. Function GetColor2( c% ) As Long

    1. GetColor2 = c% * 25

      If c% > 2 Then

      1. GetColor2 = 255' 0x0000FF - Red

      End If

      If c% > 5 Then

      1. GetColor2 = 65280' 0x00FF00 - Green

      End If

      If c% > 8 Then

      1. GetColor2 = 16711680' 0xFF0000 - Blue

      End If

    End Function