Classes

JesseW

Active Member
Licensed User
Longtime User
I would *LOVE* to see classes implemented in B4P!! That would give a more oop flavor to development. I would imagine something like this...

B4X:
Public Class Classname
   'Declare methods and properties here
   Public Method Methodname(arglist...)
   Private Input Output Property Propertyname1(arg)
   Public Input Output Property Propertyname2(arg)
End Class

Public Sub ClassInitialize
End Sub

Public Sub ClassDispose
End Sub

Public Sub Methodname(arglist...)
End Sub

Private Sub Propertyname1(arg)
   ' No need for class-scoped variables -- use properties for true oop
   Static p1
   If isInput(arg) Then
      p1 = arg
   End If
   Return p1
End Sub

Public Sub Propertyname2(arg)
   Static p1
   ' How to 'self reference'
   If isInput(arg) Then
      p1 = p1 + .Propertyname1
   End If
   Return p1
End Sub

Well, what do you think???
 

Cableguy

Expert
Licensed User
Longtime User
Classes are already usable as long as they are created and compiled in c#....
 

JesseW

Active Member
Licensed User
Longtime User
Classes are already usable as long as they are created and compiled in c#....

compiled as external libraries? then imported as objects in the components screen? problem is i am a basic programmee and dont like c... :(
 
Top