This is what I have been doing, but when the application grows, the number of variables and functions also grows.
I think this is closer since the function will return only the necessary group of variables
B4X:
Sub Process_Globals
'tipo de alertas
Type tpa (Alerta As Int, Confirmacion As Int, Informacion As Int, Error As Int)
End Sub
Public Sub TpAlerta As tpa
Dim x As tpa
x.Initialize
x.Alerta =1
x.Confirmacion=2
x.Informacion =3
x.Error =4
Return x
End Sub
'from other modules called
vari.TpAlerta.Alerta
The type gets compiled to a Static class, so you are not really saving anything over creating a code module for each variable type, and it's easier to access.
Code module Name = CAlerta
B4X:
Sub Process_Globals
'tipo de alertas
Public Const Alerta As int = 1
Public Const Confirmacion As int = 2
Public Const Informacion As int = 3
Public Const Error As int = 4
End Sub
'Usage
CAlerta.Alerta
If you name them all carefully, you can get them to appear where you want in the intellisense menu. If you are writing a suite of apps, you can compile them to a library.