1. How do you avoid creating class with name that won't conflict with your code?
Example, I create a class name ID.
When I declare a variable
This will cause a warning:
2. Use prefix?
Example, use ClsID instead of ID.
It is a solution but for me the class name is not elegant.
3. Is there any way that we can use namespace?
Example,
where ID is a class.
Maybe the class can be put inside a folder or nested folders?
I am trying to create a b4xlib that contains 100+ of classes with getters and setters to use in my project.
Example, I create a class name ID.
When I declare a variable
B4X:
Dim id As Long
B4X:
Variable name is the same as a module name. This can cause problems during debugging. (warning #30)
2. Use prefix?
Example, use ClsID instead of ID.
It is a solution but for me the class name is not elegant.
3. Is there any way that we can use namespace?
Example,
B4X:
Dim id As Invoice.ID
Maybe the class can be put inside a folder or nested folders?
I am trying to create a b4xlib that contains 100+ of classes with getters and setters to use in my project.