Creating an Object

colboy

Member
Licensed User
Longtime User
I'm coming from the VB.NET world and have many objects that look something like this:

B4X:
Public Class objAsset
    Public SysAssetId As String
    Public UIC As String
    Public Description As String
    Public CurrentId As String
    Public SerialNumber As String
    Public SysModelId As String
    Public SysLocationId As String
    Public Active As Integer
    Sub Clear()
        SysAssetId = ""
        UIC = ""
        Description = ""
        CurrentId = ""
        SerialNumber = ""
        SysModelId = ""
        SysLocationId = ""
        Active = 1
    End Sub
End Class

I've looked at the forums, but can't find an answer. How can I replicate this functionality in B4A?

Thanks, Colin
 

stevel05

Expert
Licensed User
Longtime User
Something like

B4X:
Sub Process Globals
   Type objAsset(SysAssetId As String,UIC As String,Description As String, _
   CurrentId As String, SerialNumber As String, SysModelId As String, _
   SysLocationId As String, Active As Int)
End Sub

Sub Activity_Create(FirstTime As Boolean)
  Dim Obj1 As objAsset
  InitobjAsset(Obj1)
End sub

Sub InitobjAsset(Thisobj As objAsset)
   Thisobj.Initialize
   Thisobj.Active=1
End Sub

Steve
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…