Hi,
I'm trying to make a class "User" where I save the logged user data. Then I wrote some public set/get subs for all the private attributes, but I can't access to these subs from other activities where I defined a variable of that class.
This is the code of the class:
In the main activity I defined a global variable as:
But when I try to use the class methods, I get this:
What am I doing wrong?
I'm trying to make a class "User" where I save the logged user data. Then I wrote some public set/get subs for all the private attributes, but I can't access to these subs from other activities where I defined a variable of that class.
This is the code of the class:
LoggedUser class:
Sub Class_Globals
Private Id As Int
Private Email As String
Private Username As String
Private Psw As String
Private User_Type As String
Private Method_Access As String
Private Ucoin As Int
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
Id = 0
Email = ""
Username = ""
Psw = ""
User_Type = ""
Method_Access = ""
Ucoin = 0
End Sub
'metodi get/set
Public Sub setId(num As Int)
Id = num
End Sub
Public Sub getId As Int
Return Id
End Sub
Public Sub setEmail(str As String)
Email = str
End Sub
Public Sub getEmail As String
Return Email
End Sub
Public Sub setPsw(str As String)
Psw = str
End Sub
Public Sub getPsw As String
Return Psw
End Sub
Public Sub setUsername(str As String)
Username = str
End Sub
Public Sub getUsername As String
Return Username
End Sub
Public Sub setTyp(str As String)
User_Type = str
End Sub
Public Sub getTyp As String
Return User_Type
End Sub
Public Sub setMethod(str As String)
Method_Access = str
End Sub
Public Sub getMethod As String
Return Method_Access
End Sub
Public Sub setUcoin(num As Int)
Ucoin = num
End Sub
Public Sub getUcoin As Int
Return Ucoin
End Sub
In the main activity I defined a global variable as:
LoggedUser instance:
Sub Process_Globals
Dim Utente As LoggedUser
End Sub
But when I try to use the class methods, I get this:
What am I doing wrong?