Andre Souza Member Licensed User Nov 11, 2015 #1 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
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
opus Active Member Licensed User Longtime User Nov 12, 2015 #2 I would put those strings in a resource-file. That way you can use the same file in different Projects. Resource file: https://www.b4x.com/android/forum/threads/localize-your-app-using-androidresources.19165/#content Upvote 0
I would put those strings in a resource-file. That way you can use the same file in different Projects. Resource file: https://www.b4x.com/android/forum/threads/localize-your-app-using-androidresources.19165/#content
Erel B4X founder Staff member Licensed User Longtime User Nov 12, 2015 #3 Andre Souza said: From what I am seeing , it would be an activity containing the variables in the " Process_Global " section. It's correct? Click to expand... Actually it should be a (static) code module. You can also use the Const modifier: Code: Sub Process_Globals Public Const MESSAGE_ALERTA = "Hello", MESSAGE_ERRO = "Error" As String Upvote 0
Andre Souza said: From what I am seeing , it would be an activity containing the variables in the " Process_Global " section. It's correct? Click to expand... Actually it should be a (static) code module. You can also use the Const modifier: Code: Sub Process_Globals Public Const MESSAGE_ALERTA = "Hello", MESSAGE_ERRO = "Error" As String