Results 1 to 4 of 4

Thread: Disagrement

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Question

    Don't mean to stir things, cause arguments between you all, but 2 things:

    I use Private & Public statements at the moment, is there any advantages with any of the others, and why is it so bad to use the global statement?

    Secondly, I also use modules, but cannot see a use for the class objects, can someone please give me an example of why I would choose this over a module, the point of it?

    Thank you everyone, I have always wanted to know these, I do not use them, and cannot see the point at the moment (you will probably sset me straight here though).

    Alex Read

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    You wrote:
    "I use Private & Public statements at the moment, is there any advantages with any of the others, and why is it so bad to use the global statement? "

    What others?

    Globals? --> Public is Global - sort of.

    Using Classes allows you to create instances and call the methods using simple ClassName.Method notation. It also allows Data Hiding to a certain extend. There is much more to it than this, but would take more than 3 paragraphs to explain.

    You are right in that this is not really Object Oriented Programming, although some might try and argue that it is. Wait for VB7 which promised Encapsulation, Inheritance, Polymorphism, Overloading etc (see MS web site).

    I cannot wait.

  3. #3

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Lightbulb reply 2 reply

    Global & Static are two more scopes, there was another like global beginning with P that I read about a while back, but have forgotten, I just cannot see any advantages with these in the MSDN collection & was hoping for some of your views on the subject.

    Also, if the cls object is not that easy to explain, is there any references ie-sites I could check this out on?

    Thank you!
    Alex Read

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    The only difference between Global and Public is that you cannot use Global inside any classes, only in standard modules. In other words there is no use of Global.

    Static can be used as variable inside a procedure which does not unload itself like Dim when exiting it. Once a static variable is initialized, it lasts until the class or application unloads.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width