|
-
May 30th, 2000, 10:46 PM
#1
Thread Starter
Addicted Member
I have started out reading books on vb,and i have got a good basic idea how vb works....but! in all my books..it doesnt explain this simple question i have..
When you create a function,can you "name" it whatever you want? So if i wanted to create a function named
Formatharddrive() all i would have to do is input the code and will it work?Or is there a predetermined set of functions that we all have to live by.(for vb)
Thank you in advance for any help.
-
May 30th, 2000, 10:53 PM
#2
transcendental analytic
You can name your functions/Subs/Properties whatever you want
Code:
Function Formatharddrive()
'Your code of the formatting harddrive goes here
End function
Sub DeleteWindows()
'Your code goes here
End sub
Property Get Whatisthisallabout()
'Your explanations here
End property
Feel free to ask more, this site is for you, those books probably don't worth the money you spent on them
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.
-
May 30th, 2000, 10:53 PM
#3
Addicted Member
Pretty much. You have two groups of subs or functions. You have those that execute as a result of an event firing, and those you create, that you call from another sub or function. Those that you create, you can name anything you want except for the names reserved for the event firing ones.
There is also a difference between functions and subs (sub routines). Functions return an object, subs don't.
-
May 30th, 2000, 10:58 PM
#4
Fanatic Member
yep. you can call functions and subs pretty much what you want. Obviously there are some illegal characters and it would be silly to try and name a function the same as one that already exists. but
Code:
Private Function Format_Hard_Drive() as Boolean
End Function
'or
Private Sub I_Hate_Windows()
End Sub
Would be fine.
Iain, thats with an i by the way!
-
May 30th, 2000, 11:16 PM
#5
transcendental analytic
I forgot to tell if you you will experience problems if you name your methods with the same name as other vb's methods. That's a big problem for newbies
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.
-
May 31st, 2000, 02:43 AM
#6
I hope that VB7 will have an option for VB Code Editor to reconize your functions and highlight it in blue. C++ has the ability to do this, I'm sure they can put it in VB.
-
May 31st, 2000, 03:21 AM
#7
transcendental analytic
that would be nice, but another color, blue is already used
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.
-
May 31st, 2000, 03:47 AM
#8
Frenzied Member
meg how do you get C++ to do that.
-
May 31st, 2000, 06:50 AM
#9
There is a file that when you add to it, it will highlight whatever word is in it. I forgot the name of the file though .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|