Compile to Library: Private Type?

tchart

Well-Known Member
Licensed User
Longtime User
Loving 2.5 and the compile to class.

One of my code modules has a custom type defined. For example;

Type Point (X As Double, Y As Double)

Now when I compile this as a library this type is exposed (even though my Process_Globals is "private").

Is there a way to hide this Type from the being exposed by the library in the B4A IDE?

The example above is pretty simple but another custom type I have in the library has 10+ primitives. The type is only used internally by my code so the user doesn't need to see it.
 

Joe_L

Member
Licensed User
Longtime User
The implication of the discussion above is that types are always public. So if you want to use a type from a different module does it matter which section it is declared in?

I discovered that a type statement fails to compile when marked as public. So do the keywords public/private not apply to types?

B4X:
Public Type MYTYPE1 (a As Int, b As Int)  '!!this fails to compile
Type MYTYPE2 (a As Int,b As Int)

(Incidentally the compiler error message is not helpful so it takes a bit of fiddling to work out what's wrong with the statement.)
 
Upvote 0
Top