Public & Private in Types
BlitzMax Forums/BlitzMax Programming/Public & Private in Types
| ||
Hey, I'm having trouble with Public and Private. Here is my type basically: -Type Simulation - Public - Global current:simulation - Private - Field projectiles:tlist - Public - Method run() - Private - Method mainLoop() -End Type I get Syntax error in user defined type definition on the first Public, also I get that error when i try starting the line with public. |
| ||
Yes, we all want pub/priv in types. Until then: pray for them to popup in a next version! |
| ||
Put the cursor on "public" and press F1 Keyword Public Description Public makes a Constant, Global variable or Function accessible from outside the current source file (Default) Its called "Quick help", notice not methods |
| ||
Thanks for the tip H&K, actually, I'd already checked that. |
| ||
I'd also like to see Public/Private allowed in types next version, but I'd like them to provide the same functionallity to make variables and functions only accessable from the current source file as they're currently doing outside types and not like in Java, where they're making methods and fileds only accessable for methods in the same class. |
| ||
I'd prefer the to have both options available, personally. Something like how static & public/private/protected work in C++. |
| ||
Anyone for namespaces? :) |
| ||
Anyone for namespaces? :) We have namespaces. If you have a method called CreateButton in your current type, but you wish to use the MaxGUI CreateButton, it's just : brl.maxgui.CreateButton(Blah..) Public and Private would be nice, but - for me - kinda hollow unless we got properties as well. |
| ||
I wasn't aware of that. Thanks Gabriel. |