giggetto71 Active Member Licensed User Longtime User Sep 27, 2020 #1 Hi guys, I have a basic doubt. I am creating a B4j app where I need to define several constants which will be used by all the modules. right now I have a Constants module where I have all those constants but I was wondering if there is an alternative to reference those constants to use the ModuleName.ConstName systex. Ideally I would like to be able to use ConstName all over the project. basically: B4X: Copy if var = ConstsModule.Const1 then 'do something end if 'whish if var = Const1 then ' do something end if ..... right now the "wish" solution only works if I define the constants in the module where that code is.
Hi guys, I have a basic doubt. I am creating a B4j app where I need to define several constants which will be used by all the modules. right now I have a Constants module where I have all those constants but I was wondering if there is an alternative to reference those constants to use the ModuleName.ConstName systex. Ideally I would like to be able to use ConstName all over the project. basically: B4X: Copy if var = ConstsModule.Const1 then 'do something end if 'whish if var = Const1 then ' do something end if ..... right now the "wish" solution only works if I define the constants in the module where that code is.
LucaMs Expert Licensed User Longtime User Sep 27, 2020 #2 giggetto71 said: I was wondering if there is an alternative to... Click to expand... No. Furthermore, we I usually declare public constants in some classes, being relative to the classes themselves. Upvote 0
giggetto71 said: I was wondering if there is an alternative to... Click to expand... No. Furthermore, we I usually declare public constants in some classes, being relative to the classes themselves.
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Sep 27, 2020 #3 giggetto71 said: right now I have a Constants module where I have all those constants Click to expand... You have only this option, because it is JAVA native rule,B4X follows Java rules. In Java: any type of variable must be inside class. Upvote 0
giggetto71 said: right now I have a Constants module where I have all those constants Click to expand... You have only this option, because it is JAVA native rule,B4X follows Java rules. In Java: any type of variable must be inside class.
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2020 #4 HAH said: You have only this option, because it is JAVA native rule,B4X follows Java rules. In Java: any type of variable must be inside class. Click to expand... It has nothing to do with Java. Upvote 0
HAH said: You have only this option, because it is JAVA native rule,B4X follows Java rules. In Java: any type of variable must be inside class. Click to expand... It has nothing to do with Java.