Android Question Create file constant

Andre Souza

Member
Licensed User
Sorry for the bad English

We program in Pascal , and I'm enjoying B4A concept in its programming structure .

I like to create a constant file where I store text information in order to facilitate maintenance .

What better way to make a constants file so that I can use in any application.

From what I am seeing , it would be an activity containing the variables in the " Process_Global " section. It's correct?

Sub Process_Globals
Dim MESSAGE_ALERTA As String = "Hello"
Dim MESSAGE_ERRO As String = "Error"
End Sub

Call constant
NameActivity.MESSAGE_ALERTA
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
From what I am seeing , it would be an activity containing the variables in the " Process_Global " section. It's correct?
Actually it should be a (static) code module. You can also use the Const modifier:
B4X:
Sub Process_Globals
Public Const MESSAGE_ALERTA = "Hello", MESSAGE_ERRO = "Error" As String
 
Upvote 0
Top