B4J Question Porting VB.NET Structure?

Discussion in 'B4J Questions' started by ShaneG30, Mar 20, 2015.

  1. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    I took a break from one of the apps I was working on and starting working on a personal app and am wanting to know how I could port this VB.NET Structure to B4J:

    'Credit goes to Chadderz for this compressor included in CTools.
            Private Structure Contraction
    Public Location As Integer
    Public Size As Integer
    Public Offset As Integer

    Public Sub New(loc As Integer, sz As Integer, off As Integer)
    Location = loc
                    Size = sz
                    Offset = off
    End Sub
    End Structure
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use a custom type for this:
    Type Contraction (Location As Integer, Size As Integer, Offset As Integer)
    If you like you can create a sub that creates instances of this type:
    Sub NewContraction(Loc As Int, sz As Int, off As Int) As Contraction
    Dim c As Contration
     c.Location = Loc
     c.Size = sz
     c.Offset = off
    Return c
    End Sub
    ShaneG30 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice