Code center > Darwinbots Program Source Code

Types and members

<< < (3/5) > >>

Zelos:
is it so aswell with types that I have to write it like formname.thing when I load from another form or file thing?

PurpleYouko:
That depends a lot if you set them up as public or private types.
Public is accessable from anywhere. Private is accessable only in the same module or form.

In DB, "bot()" is defined as public so it can be accessed from anywhere in the whole program without need to say "form1.bot(23).nrg". We just use "bot(23).nrg"

Zelos:
sweet:D

Endy:

--- Quote ---Public is accessable from anywhere. Private is accessable only in the same module or form.
--- End quote ---

So would changing a var from private to public have any negative affects?

Numsgil:
It ruins encapsulation.

ie:

(in software engineering) the process of enclosing programming elements inside a larger, more abstract entity, similar to information hiding and separation of concerns. It is often associated with Object Oriented Programming. One or more of these attributes are often associated with the term:

    * Physically grouping together related operations or things.
    * "Gate keeper" of state or data; a single access point.
    * Hiding implementation details so that the external world only sees an interface. Note that functions also provide this capability.

So the code can could care less, but programmers upkeeping your code are apt to become sloppy and not use your type the way you intended.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version