Public / Private methods or functions?
BlitzMax Forums/BlitzMax Beginners Area/Public / Private methods or functions?
| ||
Is there a way to make public or private methods or functions in types? To explain further I'm making a type to use across different project. There are some functions/methods included in the type that are not to be called from outside the type, so i'm looking for a way t make them Private to the type, and eventually hope an IDE like Blide (which is sweet) wouldnt show these functions/methods when someone's using the type |
| ||
Look in the help for Public and Private |
| ||
No. |
| ||
...but there really should be. |
| ||
Should be, but there aren't, despite the past requests. |
| ||
At the moment, public - private are "pointless" ... they don't do anything to the compiled module ... the only thing private does is prevent that an entry for this method / function / field / local / global is added to the Interface (.i) file. So if you need a private method, feel free to do it by simply removing the entries from the .i files ... |
| ||
I'd like this too. All I've heard suggested is stick _ on the start of the private fields and function names so they look differnt :-( |
| ||
At the moment, public - private are "pointless" ... they don't do anything to the compiled module ... the only thing private does is prevent that an entry for this method / function / field / local / global is added to the Interface (.i) file. So if you need a private method, feel free to do it by simply removing the entries from the .i files ... Interface files aren't generated for code that isn't in a module. |
| ||
You are right, private removes it from module usable part completely. But still: removing its entry from .i will take care that others can't use it unless the know the exact naming etc to reconstruct the line ... |