Results 1 to 4 of 4

Thread: sub <> sub : function = ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146

    Post

    whats the difference between a sub and a function

    and for what do i need the property set/get/let ?
    i never used the property-thing.


  2. #2
    Guest
    A Function returns a value whereas a Sub does not.

    You can use a Property for setting values, for example, if you were making a Timer you can create a Property for it's Interval.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146
    ?

    if i want to change the interval, i type timer1.interval = 100 in a sub or function.

    i am NOT a professional vb programmer. i teached myself qbasic and then i changed to vb 6

    cant you send me a detailed description?

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Functions and subs are much the same as in qbasic, except you don't use declare statement. VB6 is object oriented so you'll probably start with the form object, or a module with a sub called main, you choose it from project properties. If you use a standard module, with the sub main, it will load first and terminate when all forms are unloaded. But when you start with a form, it will load up and execute the events, the subs that will fire on certain circumstances, for instance when you click on the form or unload it. These events can be used as normal subs and functions.

    For instance the timer control will have a timer event that will fire on a specified interval, you can specify it in designtime in the properties window and in runtime using it's interval property as you yourself mentioned.
    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