Hello!
This might sound stupid but let me explain and try to prevent the negativism.
I have a Code Module "AppSettingsStyles"
In process globals, I define multiple settings values(something I've inherited while learning from Klaus).
Let's see what I've got:
However, if I do something like this:
It compiles just fine.
It's better for me to stick the values initialization to the declaration as it will be faster to change anything.
But is there a serious reason NOT to declare it there? I've done it because it's app settings and I just need to access them from every activity.
If, interested, here is what tActivityProperties is.
I read such errors by other people. Erel, you told them to verify they have no old versions of internal libraries. I can be my no means sure I don't have some but I made install in a different directory so that shouldn't be the case, at least according to my opinion.
This might sound stupid but let me explain and try to prevent the negativism.
I have a Code Module "AppSettingsStyles"
In process globals, I define multiple settings values(something I've inherited while learning from Klaus).
Let's see what I've got:
B4X:
'AppSettings code module
Sub Process Globals
Dim aCompaniesAddEditSettings As tActivityProperties
' aCompaniesAddEditSettings.Initialize(Colors.Yellow, "", 20, Colors.Red) ' this doesn't work because it produces a compile error(read below).
End Sub
B4X:
Sub setInit()
aCompaniesAddEditSettings.Initialize(Colors.Yellow, "", 20, Colors.Red)
End Sub
It compiles just fine.
It's better for me to stick the values initialization to the declaration as it will be faster to change anything.
But is there a serious reason NOT to declare it there? I've done it because it's app settings and I just need to access them from every activity.
If, interested, here is what tActivityProperties is.
B4X:
' I don't see any ActivityContext here. I even tried this(Dim dummy as View) and the compile process is broken in a different way.
'Class module
Sub Class_Globals
' Dim dummyView As View
Dim P_BgColor As Int
Dim P_BgImage As String
Dim P_TextSize As Int
Dim P_TextColor As String
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(BgColor As Int, BgImage As String, TextSize As Int, TextColor As String)
P_BgColor = BgColor
P_BgImage = BgImage
P_TextSize = TextSize
P_TextColor = TextColor
End Sub
Public Sub BgColorPro As Int
Return P_BgColor
End Sub
Public Sub BgImagePro As String
Return P_BgImage
End Sub
Public Sub TextSizePro As Int
Return P_TextSize
End Sub
Public Sub TextColorPro As Int
Return P_TextColor
End Sub
I read such errors by other people. Erel, you told them to verify they have no old versions of internal libraries. I can be my no means sure I don't have some but I made install in a different directory so that shouldn't be the case, at least according to my opinion.
Attachments
Last edited: