Public & Private in Types

BlitzMax Forums/BlitzMax Programming/Public & Private in Types

Will(Posted 2006) [#1]
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.


CS_TBL(Posted 2006) [#2]
Yes, we all want pub/priv in types. Until then: pray for them to popup in a next version!


H&K(Posted 2006) [#3]
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


Will(Posted 2006) [#4]
Thanks for the tip H&K, actually, I'd already checked that.


Fabian.(Posted 2006) [#5]
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.


SculptureOfSoul(Posted 2006) [#6]
I'd prefer the to have both options available, personally.

Something like how static & public/private/protected work in C++.


SculptureOfSoul(Posted 2006) [#7]
Anyone for namespaces? :)


Gabriel(Posted 2006) [#8]
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.


SculptureOfSoul(Posted 2006) [#9]
I wasn't aware of that. Thanks Gabriel.