Basic samples. Structure types.


Structure MyStruct
  Public S As String
  Public Y As Integer = 5
  Public Z(10) As Double

  Sub New
    Dim I As Integer
    For I = 0 to Length(Z) - 1
      Z(I) = I
    Next
    S = "abbcabbcc"
  End Sub

  Sub Finalize
    println "Done"
  End Sub

  Function CountB() As Integer
    Dim I As Integer, Result As Integer = 0
    For I = 1 to Length(S)
      If S[I] = "b" Then
        result += 1
      End If
    Next
    Return Result
  End Function

End Structure

Dim P As MyStruct
println P.Y
println P.Z(4)
println Length(P.Z)
println P.CountB()


Copyright © 2006-2017 Alexander Baranovsky. All rights reserved.